Parallax scrolling
How do I make an parallax scrolling?
What is a parallax scrolling? How do you make a parallax scrolling? This script and codes were developed by Maharajan on 26 January 2023, Thursday.
Parallax scrolling - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>parallax scrolling</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body>
<div class="parallax-slider" id="slide1" data-speed="10">
</div>
<div class="parallax-slider" id="slide2" data-speed="20"> </div>
<div class="parallax-slider" id="slide3" data-speed="15">
</div>
<div class="parallax-slider" id="slide4" data-speed="10"> </div>
<div class="parallax-slider" id="slide5" data-speed="20">
</div>
</body> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Parallax scrolling - Script Codes CSS Codes
body { width: 100%; height: 100%; margin: 0px;
}
.parallax-slider { font-family: 'Elsie', cursive; color: #FFF; margin: 0 auto; width: 100%; max-width: 1920px; position: relative; min-height: 100%; text-shadow: 0 0 10px rgba(0, 0, 0, 0.7); background-position: 50% 0; background-repeat: repeat; background-attachment: fixed; height: 600px; background-color:skyblue;
}
#slide1 { background-image: url('http://images.psxextreme.com/wallpapers/ps3/spiderman_chest_868.jpg');
}
#slide2 { background-image: url('//thesmashable.com/wp-content/uploads/2014/04/amazing_spider_man_2_movie_wallpapers_desktop_backgrounds_the_amazing_spiderman_2014_hd_wallpapers-31.jpg');
}
#slide4 { background-image: url('http://hdwallpapers.move.pk/wp-content/uploads/2015/07/marvel-black-spider.jpg');
}
#slide5 { background-image: url('http://www.dipnot.tv/wp-content/uploads/2016/03/10_The-Wolverine.jpg');
}
Parallax scrolling - Script Codes JS Codes
$('.parallax-slider').each(function() { var $scrollslider = $(this); $(window).scroll(function() { var yPos = -($(window).scrollTop() /$scrollslider.data('speed')); console.log(yPos); var bgpos = '50% ' + yPos + 'px'; $scrollslider.css('background-position', bgpos); }); });
Developer | Maharajan |
Username | mhrjnsa1 |
Uploaded | January 26, 2023 |
Rating | 3 |
Size | 2,161 Kb |
Views | 4,048 |
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 |
Memory game | 2,424 Kb |
Sound waves | 1,738 Kb |
Pure css loader | 2,407 Kb |
Drop down options disable | 1,723 Kb |
Border hover effect | 1,667 Kb |
Simple register | 2,505 Kb |
Hover input | 2,148 Kb |
Notification | 2,125 Kb |
Parallax slider | 1,936 Kb |
Circle loader | 1,799 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 |
Cool audio | Bigliam | 1,868 Kb |
Animated Slide Hamburger Mobile Menu | BJack | 2,247 Kb |
Reviews and Ratings Star | Zbnmstry | 1,591 Kb |
Realistic Buttons | Stoypenny | 2,248 Kb |
Two tables and header with jspdf-autotable | Someatoms | 2,245 Kb |
Svg penguin | _massimo | 2,990 Kb |
Formations | Cantelope | 5,731 Kb |
Sassy Buttons | Elyseholladay | 2,299 Kb |
To Do List with Delete | Mattlbrody | 2,068 Kb |
Css or Czz.. | Judag | 4,111 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!