Skip to content
This repository has been archived by the owner on Feb 11, 2019. It is now read-only.

A jQuery plugin that changes the background color of an element, based on the scroll position of the document.

Notifications You must be signed in to change notification settings

hendriklammers/jquery-colorscroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colorScroll

A jQuery plugin that changes the background color of an element, based on the scroll position of the document.

Currently it only works as scroll event on the document. So if the document's height doesn't exceed the window's height (i.e. There's nothing to scroll), no color transitions will be done.

Usage

Call colorScroll on the element to which you want to apply the color transitions.
For example to change the background-color of the body element you could use the plugin like this:

$('body').colorScroll({
    colors: [{
        color: '#a2e9ff',
        position: '0%'
    }, {
        color: '#ff92f2',
        position: '40%'
    }, {
        color: '#fff094',
        position: '80%'
    }]
});

Example

A very basic example of the plugin in action can be found here.

About

A jQuery plugin that changes the background color of an element, based on the scroll position of the document.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published