Skip to content

rgrandi/jquery-subtle-parallax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

jquery-subtle-parallax

Introduction

jQuery Subtle Parallax is a lightweight (16 lines of code) jQuery plugin that is used to gently parallax a given element so long as it has a background-image assigned to it and that the background-attachment is set to fixed. For simplicity, there are no configurable options at the moment and it can be used as is - it moves the image at 33% of the rate of the rest of the browser.

In the future, I may look at adding configurable options for the plugin.

Usage Instructions

Include this file in your jQuery compilation.

$('.element').subtle_parallax();

This plugin will check the height of the element, and when the element comes into the viewport it will begin to parallax it. In order for it to work, the element will need to have a background image with the following CSS attributes:

.element {
  background-attachment: fixed;
  background-position: 50% 0%;
}

Dependencies

jQuery - jQuery must be called prior to the script that contains jQuery Subtle Parallax.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published