Background-attachment fixed
How do I make an background-attachment fixed?
Some dancing divs showing us a fancy way of using background-attachment fixed.. What is a background-attachment fixed? How do you make a background-attachment fixed? This script and codes were developed by Alejandro Montañez on 13 October 2022, Thursday.
Background-attachment fixed - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Background-attachment fixed</title> <link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>background-attachment fixed</h1>
<div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <input type='button' value="press to toggle 'fixed'">
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Background-attachment fixed - Script Codes CSS Codes
/* Say hello: @codeams */
html, body, div, h1, input { margin: 0; padding: 0; font: 300 32px/1 Open Sans Condensed, sans-serif;
}
html, body { width: 100%; height: 100%; background: #0e0f10;
}
h1 { margin-top: 20px; letter-spacing: 3px; white-space: nowrap; font-weight: 300; text-align: center; text-transform: uppercase; color: #a0a0a0;
}
body > div { width: 678px; margin: 10px auto 0; text-align: center;
}
body > div > div { width: 216px; height: 90px; position: relative; float: left; margin: 10px 0 0 10px; border-radius: 3px; background: url(https://s18.postimg.org/siyudzyqh/cosmos.jpg) no-repeat center center; background-attachment: fixed; background-size: cover;
}
input { margin: 20px 0; padding: 10px 20px; letter-spacing: 4px; font-size: 0.7rem;
}
input:active { position: relative; top: 2px;
}
.unfix { background-attachment: initial;
}
Background-attachment fixed - Script Codes JS Codes
var div = $('div:first > div'), duration = 500, rand = function(a, b){ return Math.round(Math.random() * (b - a) + a) }, animate = function(){ div.each(function(){ $(this).animate({ top : rand(-4, 10), left : rand(-4, 10) }, duration) }) };
setInterval(animate, duration)
animate() // why wait?
$('input').click(function(){div.toggleClass('unfix')})
Developer | Alejandro Montañez |
Username | codeams |
Uploaded | October 13, 2022 |
Rating | 4.5 |
Size | 3,138 Kb |
Views | 28,336 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Next Effect | 3,103 Kb |
Random | 3,604 Kb |
My favorite palettes | 4,751 Kb |
Another loading animation | 2,463 Kb |
My favorite palettes | 4,742 Kb |
Bounce-in css animation | 2,313 Kb |
Sticky navigation sample | 3,642 Kb |
Letter-spacing animation | 2,288 Kb |
My favorite colors | 3,221 Kb |
Something | 2,615 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Drag and Drop Quiz | Cgspicer | 3,837 Kb |
BabyStore | Pablo-Ai | 3,807 Kb |
Subscription Newsletter - Before inlining | Bradstrong | 7,526 Kb |
React Vote Component | Souporserious | 5,465 Kb |
The CodePen Logo | Kindofone | 4,259 Kb |
Cool audio | Bigliam | 1,868 Kb |
Fun animations with CSS3 | Minimalmonkey | 2,360 Kb |
Popover Example | Seanboom | 2,429 Kb |
Navcube | Wbarlow | 4,775 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!