Hi Maarten, I came across this jQuery plugin on Sitepoint.
Add this to your placeholder (head section)
HTML Code:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript">
$(function() {
var ele = $('#inner-scroll');
var speed = 25, scroll = 5, scrolling;
$('#scroll-up').mouseenter(function() {
// Scroll the element up
scrolling = window.setInterval(function() {
ele.scrollTop( ele.scrollTop() - scroll );
}, speed);
});
$('#scroll-down').mouseenter(function() {
// Scroll the element down
scrolling = window.setInterval(function() {
ele.scrollTop( ele.scrollTop() + scroll );
}, speed);
});
$('#scroll-up, #scroll-down').bind({
click: function(e) {
// Prevent the default click action
e.preventDefault();
},
mouseleave: function() {
if (scrolling) {
window.clearInterval(scrolling);
scrolling = false;
}
}
});
});
</script>
on the line where you see var ele = $('#inner-scroll'); change the red to the id of your scroll box and where you see var speed = 25, scroll = 5, scrolling; change the red to adjust the scroll speed.
Next using the name tag give the name scroll-up to the up arrow(image) and scroll-down to the down arrow(image)
You can see a demo here
Bookmarks