A jquery plugin that creates a simple, clean, and powerfull parallax effect.
See live demo: https://snakeparallax.github.io/snakeparallax/
Get the latest jQuery library.
First, include JQuery and Snake.Parallax.js files into your HTML head:
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="js/Snake.Parallax.js"></script>
Second, call the Snake Parallax initializer.
<script>
$(document, window).SnakeParallax({
backgroundImage:"url('YOUR_HERO_IMAGE')"
});
</script>
You need to create a div or section tag for your hero section, and add the attribute snake-parallax="hero". You do not need to create a special class, id, or css style for the section.
<section snake-parallax="hero">
YOUR CONTENT
</section>
Your parallax is ready!
- reset.css: source code.
- Background image: Photo by Pedro Lastra on Unsplash.