Smooth Background Color Transition Effect On Scroll - scrollColor

File Size: 3.36 KB
Views Total: 5117
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Smooth Background Color Transition Effect On Scroll - scrollColor

scrollColor is a really simple jQuery plugin used to gradually change background colors (RGB) while scrolling down/up the webpage.

How to use it:

1. Load the jQuery scrollColor plugin after you've loaded the latest version of jQuery library (slim build is recommended).

<script src="//code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script src="scrollColor.js"></script>

2. Call the function on the target container and specify the starting / ending colors in RGB format.

changeColor("container", r1, g1, b1, r2, g2, b2);

3. Customize the ending point.

// scrollFromTop: the distance from the top
// in pixels
changeColor("container", r1, g1, b1, r2, g2, b2, scrollFromTop);

This awesome jQuery plugin is developed by amirtatin. For more Advanced Usages, please check the demo page or visit the official website.