Background-attachment fixed

Size
3,138 Kb
Views
28,336

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 Previews

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')})
Background-attachment fixed - Script Codes
Background-attachment fixed - Script Codes
Home Page Home
Developer Alejandro Montañez
Username codeams
Uploaded October 13, 2022
Rating 4.5
Size 3,138 Kb
Views 28,336
Do you need developer help for Background-attachment fixed?

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!

Alejandro Montañez (codeams) Script Codes
Create amazing art & images with AI!

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!