Download
User Rating: 4.7/5 ( 1 votes)
Main features
-
Works on touch devices like iPhone, iPad and Android smartphones.
-
Smooth scrolling - no distinct steps.
-
Endless loops, if you want.
-
Many different scrolling methods: touch, hot spots, mouse wheel och auto scrolling. Or combinations of these!
-
Make any type of content scrollable, not just images.
-
Easing options for a smoother scrolling experience.
Apart from many of the other scrolling plugins that have been written for jQuery, Smooth Div Scroll does not limit the scrolling to distinct steps. As the name of the plugin hints, scrolling is smooth. There are no other buttons or links on outside the scroller since the scrolling is done using your fingers (touch), hotspots, the mouse wheel or via auto scrolling.
The jQuery code for this particular demo looks like this:
<script type="text/javascript">
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"
});
});
</script>
In this particular demo I've set some options that override the default options:
-
mousewheelScrolling: "allDirections" - The user can scroll using the mouse wheel, both horizontally and vertically (not all mice have a vertical scrolling function though)
-
manualContinuousScrolling: true - The scroller becomes endless in both directions when the user scrolls manually (using the hotspots or the mousewheel).
-
autoScrollingMode: "onStart" - The scroller will start auto scrolling as soon as the page has loaded and stop auto scrolling as soon as the user interacts with the scoller.
I've used only a few of all the available options. You'll find all the options described here.) In the demo above the HTML-code looks like this:
<div id="makeMeScrollable">
<img src="images/demo/field.jpg" alt="Field" id="field" />
<img src="images/demo/gnome.jpg" alt="Gnome" id="gnome" />
<img src="images/demo/pencils.jpg" alt="Pencils" id="pencils" />
<img src="images/demo/golf.jpg" alt="Golf" id="golf" />
<img src="images/demo/river.jpg" alt="River" id="river" />
<img src="images/demo/train.jpg" alt="Train" id="train" />
<img src="images/demo/leaf.jpg" alt="Leaf" id="leaf" />
<img src="images/demo/dog.jpg" alt="Dog" id="dog" />
</div>
As you can see there is a surrounding div with the id makeMeScrollable. This is the element that I turn into a Smooth Div Scroll. Inside this div you can put any content - not just images.
Please note that you may have to give the elements that you put inside the scrollable area some styling to make sure that they are positioned like you want them. Here's a good template to start with:
#makeMeScrollable div.scrollableArea *
{
position: relative;
display: block
float: left;
margin: 0;
padding: 0;
/* If you don't want the images in the scroller to be selectable, try the following
block of code. It's just a nice feature that prevent the images from
accidentally becoming selected/inverted when the user interacts with the scroller. */
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
In this example there's no space between the elements inside the scrollable area. If you want a space between them, use padding and not margin since margin tends to generate errors in Internet Explorer.
Detail of options that you can use to configure and control the plugin:
-
Options
-
Altering options after initialization
-
Public methods
-
Callbacks
-
The CSS