This time I will share jQuery Plugin and tutorial about Infinite & Automatic Scroller Plugin – jQuery smoothDivScroll, hope it will help you in programming stack.
smoothDivScroll is a jQuery based smooth scroller/slider plugin that smoothly and infinitely scrolls through a set of HTML elements with mousewheel or by clicking on the right.left arrows navigation.
Dependencies:
- jQuery.
- jQuery UI (for easing functions).
- jQuery Mousewheel plugin.
How to use it:
1. Include the necessary JavaScript libraries on the html page.
1 |
< script src = "/path/to/jquery.min.js" ></ script > |
2 |
< script src = "/path/to/jquery-ui.min.js" ></ script > |
3 |
< script src = "/path/to/jquery.mousewheel.min.js" ></ script > |
2. Include the jQuery smoothDivScroll plugin’s files on the page.
1 |
< link rel = "stylesheet" href = "css/smoothDivScroll.css" > |
2 |
< script src = "js/jquery.smoothdivscroll-min.js" ></ script > |
3. Insert a group of HTML elements to the scroller.
1 |
< div id = "makeMeScrollable" > |
2 |
< img src = "1.jpg" alt = "Demo image" > |
3 |
< img src = "2.jpg" alt = "Demo image" > |
4 |
< img src = "3.jpg" alt = "Demo image" > |
5 |
< img src = "4.jpg" alt = "Demo image" > |
6 |
< img src = "5.jpg" alt = "Demo image" > |
4. Initialize the scroller with no custom options.
1 |
$( "div#makeMeScrollable" ).smoothDivScroll(); |
5. Auto start the scroller on page load.
01 |
$( "div#makeMeScrollable" ).smoothDivScroll({ |
04 |
autoScrollingMode: "" , |
07 |
autoScrollingDirection: "endlessLoopRight" , |
13 |
autoScrollingInterval: 10, |
16 |
autoScrollingPauseOnHover: false |
6. Enable/disable the mousewheel functionality.
01 |
$( "div#makeMeScrollable" ).smoothDivScroll({ |
04 |
mousewheelScrolling: "" , |
07 |
mousewheelScrollingStep: 70, |
10 |
easingAfterMouseWheelScrolling: true , |
13 |
easingAfterMouseWheelScrollingDuration: 300, |
16 |
easingAfterMouseWheelScrollingFunction: "easeOutQuart" , |
7. Config the hotspot scrolling.
01 |
$( "div#makeMeScrollable" ).smoothDivScroll({ |
03 |
hotSpotScrolling: true , |
04 |
hotSpotScrollingStep: 15, |
05 |
hotSpotScrollingInterval: 10, |
06 |
hotSpotMouseDownSpeedBooster: 3, |
07 |
visibleHotSpotBackgrounds: "hover" , |
08 |
hotSpotsVisibleTime: 5000, |
09 |
easingAfterHotSpotScrolling: true , |
10 |
easingAfterHotSpotScrollingDistance: 10, |
11 |
easingAfterHotSpotScrollingDuration: 300, |
12 |
easingAfterHotSpotScrollingFunction: "easeOutQuart" , |
8. Default CSS classes for elements.
01 |
$( "div#makeMeScrollable" ).smoothDivScroll({ |
03 |
scrollingHotSpotLeftClass: "scrollingHotSpotLeft" , |
04 |
scrollingHotSpotRightClass: "scrollingHotSpotRight" , |
05 |
scrollingHotSpotLeftVisibleClass: "scrollingHotSpotLeftVisible" , |
06 |
scrollingHotSpotRightVisibleClass: "scrollingHotSpotRightVisible" , |
07 |
scrollableAreaClass: "scrollableArea" , |
08 |
scrollWrapperClass: "scrollWrapper" , |
9. Misc settings.
01 |
$( "div#makeMeScrollable" ).smoothDivScroll({ |
07 |
manualContinuousScrolling: false , |
09 |
scrollToEasingFunction: "easeOutQuart" |
This awesome jQuery plugin is developed by tkahn. For more Advanced Usages, please check the demo page or visit the official website.