Skrollr basic implementation

Developer
Size
2,467 Kb
Views
42,504

How do I make an skrollr basic implementation?

Full explanation at http://www.bram.us/2014/01/01/skrollr-css-animations-linked-to-scroll-position/. What is a skrollr basic implementation? How do you make a skrollr basic implementation? This script and codes were developed by Bramus on 23 July 2022, Saturday.

Skrollr basic implementation Previews

Skrollr basic implementation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Skrollr basic implementation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- For a full explanation of this code, please refer to the blogpost at http://www.bram.us/2014/01/01/skrollr-css-animations-linked-to-scroll-position/ -->
<div id="box1">box1</div>
<div id="box2">box2</div>
<script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="https://prinzhorn.github.io/skrollr/dist/skrollr.min.js"></script> <script src="js/index.js"></script>
</body>
</html>

Skrollr basic implementation - Script Codes CSS Codes

/* For a full explanation of this code, please refer to the blogpost at http://www.bram.us/2014/01/01/skrollr-css-animations-linked-to-scroll-position/ */
body { margin: 0; padding: 0; background: #fff fixed url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAABlBMVEX4+Pj09PQf/c7fAAAAGklEQVR4Xq3MIQEAAADDIPqX/kvMIMEWEm8O7b0/wewc/NcAAAAASUVORK5CYII=) repeat;
}
div { overflow: hidden; text-align: center;
}
#box1 { position: fixed; background: blue; margin: auto; top: 0; left: 0; right: 0; bottom: 0;
}
#box2 { position: fixed; background: red; height: 100px; width: 100%; margin-top: 50px;
}

Skrollr basic implementation - Script Codes JS Codes

// For a full explanation of this code, please refer to the blogpost at http://www.bram.us/2014/01/01/skrollr-css-animations-linked-to-scroll-position/
// setSkrollr function extracted from https://www.pingdom.com/2013/
var setSkrollr = function($el, data) { for (var i = 0, l = data.length; i < l; i++) { var d = data[i], px = d[0]; css = d[1]; $el.attr('data-' + px, css); }
}
jQuery(function($) { setSkrollr($('#box1'), [[0, 'width:100%'], [1500, 'width:0%']]); setSkrollr($('#box2'), [[0, 'transform:translateX(-100%)'], [750, 'transform:translateX(100%)'], [1500, 'transform:translateX(-100%)']]); skrollr.init({ smoothScrolling: false });
});
Skrollr basic implementation - Script Codes
Skrollr basic implementation - Script Codes
Home Page Home
Developer Bramus
Username bramus
Uploaded July 23, 2022
Rating 3.5
Size 2,467 Kb
Views 42,504
Do you need developer help for Skrollr basic implementation?

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!

Bramus (bramus) Script Codes
Create amazing love letters 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!