Scrolling background color
Change the background color on scrolling
Usage
-
Include jQuery & $.Color:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="http://code.jquery.com/color/jquery.color-2.1.0.js"></script>
-
Include plugin's code:
<script src="dist/jquery.scrolling-background-color.js"></script>
-
Call the plugin:
$(window).scrollingBackgroundColor(); // for the entire page background // or $('#element').scrollingBackgroundColor(); // for the background of #element
-
Options:
$( "#element" ).scrollingBackgroundColor( { from: "#CCCCCC", // startcolor to: "#FFFFFF", //tocolor target: 'body', // container changing colorΒ watch : '#element' // on scrolling } );
Demo
You will find a demo file on demo/index.html or live http://moshifr.github.io/scrolling-background-color/
Structure
The basic structure of the project is given in the following way:
βββ demo/ β βββ index.html βββ dist/ β βββ jquery.scrolling-background-color.js β βββ jquery.scrolling-background-color.min.js βββ .editorconfig βββ .gitignore βββ .jshintrc βββ .travis.yml βββ Gruntfile.js βββ package.json