Smooth and Lightweight Parallax Scroll Library in Pure Javascript

Lightweight and seamless parallax scrolling library implemented in pure javascript using hardware acceleration for additional performance.

Main Features

Extremely lightweight with no dependencies

A few kilobytes of pure JavaScript.

Viewport animation only

Parallax elements are only animated in the current viewport, which saves a lot of resources.

Dynamic Scaling

Image elements are sized and adjusted dynamically with respect to the PV velocity.

Performance is the key

Vanilla Parallax maximizes your parallax effects with hardware acceleration and no external libraries.

Media type independence

The parallax effect applies not only to photos but to videos as well. The audio of the videos will be played if the videos are clicked and remain within the viewport.

Must Read: Simple and Easy To Use Parallax Scrolling Plugin for jQuery | scrolly

How to make use of it:

Include both vanilla-Parallax.js and vanilla-Parallax.css on the webpage.

<link rel="stylesheet" href="vanilla-parallax.css">
<script src="vanilla-parallax.min.js"></script>

Add your parallax images to a container using themes.

<div class="para-container" para-height="50vh">
  <div class="para-block" para-speed=-1.0 para-image="bg.jpg"></div>
</div>

You can also apply a parallax scrolling effect to target containers and blocks.

vp.init({
  container : {
    class : 'para-container',
    height : '333px',
    heightSuffix : 'px'
  },
  block : {
    class : 'para-block',
    speed : -1,
    mediatype: image, // image, video or none
    mediapath: "bg.jpg", // path to file
    mute: false
  }
});

Browser support

Tested browsers:

ChromeSafariFirefox
60+10+44+

JavaScript Settings

Must Read: Smooth Parallax Scrolling Background Image In Pure CSS Library

NameTypeDefaultDescriptionExample values
settingsObject{container, block}Settings object. These settings will be applied to each container and block. Can be individually overwritten by data attributes.{container: {…}, block: {…}
settings.containerObject{class, height}The container object.{…}
settings.container.classStringpv-containerThe class of the container element. Remember to update the CSS classes if you wish to change this.pv-container
settings.container.heightString || Number250pxThe container’s height is in either pixels or viewport heights. If the string lacks a suffix, or a number is entered, it will default to pixels.250px, 50vh, 250
settings.blockObject{class, speed, mediatype, mediapath}The block object.{…}
settings.block.classStringpv-blockThe class of the block element. Remember to update the CSS classes if you wish to change this.pv-block
settings.block.speedNumber || Float-Math.PIThe speed and direction at which the parallax animated. Negative values will animate the `block` upwards when scrolling downwards on the page.1, 1.5, -1, -1.5
settings.block.mediatypeStringimageThe block’s media type. Blocks with media paths containing a video extension will automatically be considered videos.image, video, or none
settings.block.mediapathStringundefinedThe block’s media path.../path/to/file.ext
settings.block.muteBooleanfalseDefines whether or not all videos should be muted.true or false

See Demo And Download

simple-parallax-scrolling-js

Official Website(erikengervall): Click Here

This superior jQuery/javascript plugin is developed by erikengervall. For extra Advanced Usage, please go to the official website.

Related Posts

Google-Translate-Dropdown-Customize-With-Country-Flag

Google Translate Dropdown Customize With Country Flag | GT API

Flag google translates jQuery text that takes advantage of the Google Cloud Translation API to translate web content between languages by selecting a country from the dropdown…

Bootstrap-Fileinput

HTML 5 File Input Optimized for Bootstrap 4.x./3.x with File Preview | Bootstrap Fileinput

bootstrap-fileinput is an improved HTML 5 file input  Bootstrap 5.x, 4.x and 3.x with file preview for different files, provides multiple selections, resumable section uploads, and more….

HStack-and-VStack-in-CSS

CSS Layout Components Horizontal/Vertical Stack | HStack and VStack

HStack and VStack in CSS – CSS layout components that (basically) stack anything horizontally and vertically. A pure CSS library that makes it easy to stack elements…

Floating-Whatsapp-Chat-Button

How to Add Floating Whatsapp Chat Button In HTML | venom-button

Venom Button is a very simple plugin for the jQuery floating WhatsApp button. Adds a floating button to your site that calls WhatsApp Click to Chat API. It will automatically start the WhatsApp…

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…

alert-confirm-prompt-attention-js

Simple Alert, Confirm, Prompt Popup Using Vanilla JavaScript Library | attention.js

JavaScript provides various built-in functionality to display popup messages for different purposes. Attention JS is a vanillaJS plugin used to create a custom alert, confirm, or Prompt…

Leave a Reply

Your email address will not be published. Required fields are marked *