Monday, 9 September 2013

Implement scroll option ina a div with button scrolling feature

Implement scroll option ina a div with button scrolling feature

recently I tried to handle with a function
http://jsfiddle.net/junglized/vJdCD/,
jQuery(document).ready(function($) {
$(".page_up").click(function() {
if (contentPage > 1) {
contentPage--;
$(".pageContent").animate({
"margin-top" : "+=160px"
}, "fast",function() {
setPageArrows();
});}});
$(".page_down").click(function() {
if (contentPage < contentPages) {
contentPage++;
$(".pageContent").animate({
"margin-top" : "-=160px"
}, "fast",function() {
setPageArrows();
});}});
setPageArrows();
});
but I have no idea how add mouse scroll option uing css only. Adding
overflow: auto; property i usable only when div is at it's top position.
When I scroll down using added button possibility of using mouse to scroll
disappears. Anybody any ideas? is it necessary to use jQuery in this task?

No comments:

Post a Comment