Simple Parallax Scroll

Developer
Size
2,321 Kb
Views
18,216

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 Previews

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 });	});
});
Simple Parallax Scroll - Script Codes
Simple Parallax Scroll - Script Codes
Home Page Home
Developer Corbin
Username corbinmj16
Uploaded September 26, 2022
Rating 3
Size 2,321 Kb
Views 18,216
Do you need developer help for Simple Parallax Scroll?

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!

Corbin (corbinmj16) Script Codes
Create amazing captions 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!