[jQuery] JQuery.ScrollTo Plugin
I recently posted to see if anyone could direct me to a nice scrolling
plugin for the jquery library. I was pointed to jquery ScrollTo
however the documentation on it is needless to say unpleasant.
My problem is that I want to have a button when hovered to scroll
down, or another button to scroll up. and when not hovered to not
scroll. So far it's been really easy to scroll on hover for either up
or down, but it seems that I can only do one at a time, it doesn't
process both.
My code.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="scrollTo.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.bottom').hover(function() {
$('.blah').scrollTo('li:eq(1)', {duration: 10000});
});
$('.top').hover(function() {
$('.blah').scrollTo('li:eq(0)', {queue: true});
});
});
</script>
<div class="blah" style="overflow: auto; width: 350px; height:
200px;">
<li>1</li>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's
<li>16</li>
</div>
<a href="#" class="bottom">hover me to scroll down</a> <br /><br /