Simple Parallax Scroll
How do I make an simple parallax scroll?
What is a simple parallax scroll? How do you make a simple parallax scroll? This script and codes were developed by Corbin on 26 September 2022, Monday.
Simple Parallax Scroll - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Parallax Scroll</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="home" data-type="background" data-speed="40" class="pages"> <h1><img src="http://img3.wikia.nocookie.net/__cb20140401130241/logopedia/images/6/6b/The_Office_NBC_logo.png"></h1>
</div>
<div id="about" data-type="background" data-speed="0" class="pages"> <h1>THE Dwight Fart Schrute</h1>
</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>
Simple Parallax Scroll - Script Codes CSS Codes
#home { background: url("http://www.hercampus.com/sites/default/files/2015/04/26/Summer_1.jpg") repeat 50% 0 fixed; min-height: 900px; width: 100%; margin: 0 auto; position: relative; background-size: cover;
}
#home h1 { width: 100%; top: 100px; position: absolute; text-align: center; color: #fff; font-size: 29px;
}
#home h1 img { height: 158px; position: absolute; left: 0; right: 0; text-align: center; top: 350px; margin: 0 auto; width: 50%; color: #fff; text-shadow: 0 1px 2px #000;
}
#about { background: url('https://theofficescranton.files.wordpress.com/2012/09/jim-as-dwight3.png') 50% 0 no-repeat; min-height: 900px; width: 100%; margin: 0 auto; position: relative;
}
#about h1 { height: 458px; position: absolute; right: -200px; text-align: center; top: 350px; font-size: 45px; font-family: Helvetica; width: 100%; color: #fff; text-shadow: 0 1px 2px #000;
}
Simple Parallax Scroll - Script Codes JS Codes
$('div[data-type="background"]').each(function(){ var $bgobj = $(this); // assigning the object $(window).scroll(function() { var yPos = -($window.scrollTop() / $bgobj.data('speed')); // Put together our final background position var coords = '50%' + yPos + 'px'; // Move the background $bgobj.css({ backgroundPosition: coords, 'opacity': .5 }); });
});
Developer | Corbin |
Username | corbinmj16 |
Uploaded | September 26, 2022 |
Rating | 3 |
Size | 2,321 Kb |
Views | 18,216 |
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 |
Simple Parallax Scroll | 2,321 Kb |
JS Find total and using textContent | 1,610 Kb |
Diabetes Calculator | 1,874 Kb |
Slider with arrows and dots | 3,897 Kb |
Vue.js To-do List | 1,736 Kb |
A Pen by Corbin | 1,546 Kb |
Vue.js Search | 1,811 Kb |
JS Arrays | 1,913 Kb |
Javascript Ternary Operator | 1,988 Kb |
Red Box Move on Mouse Coordiantes | 1,728 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 |
Menu | Vivi_Lai | 1,210 Kb |
Pure CSS Spinners | Jlong | 2,043 Kb |
3D Text in Sass | Bookcasey | 2,766 Kb |
Login with flip 3d animation | Mariusbalaj | 3,014 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
LBCA - Mail canvas | Emnbdx | 3,856 Kb |
A Pen by Jason Kinney | Jason-kinney | 1,980 Kb |
Product item | Mymahesh11 | 2,256 Kb |
Flat UI Button | Honchoman | 2,289 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 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!