I have be working on a vertical jquery scroll and i am pretty close now but it seems to be scrolling the wrong way and i really haven't got a clue why.
can someone please help here is the link.
http://dropp.users35.interdns.co.uk/scroll/
Thanks
I have be working on a vertical jquery scroll and i am pretty close now but it seems to be scrolling the wrong way and i really haven't got a clue why.
can someone please help here is the link.
http://dropp.users35.interdns.co.uk/scroll/
Thanks
Try this, I tested it on my end it is working fine
Working demo
$(function () {
var scrollPane = $(".slider_container");
var scrollContent = $(".scroll-content");
// Slider
$('#slider').slider({
orientation: "vertical",
value: 100,
slide: function (event, ui) {
console.log(ui.value);
console.log(scrollPane.height());
if (scrollContent.height() > scrollPane.height()) {
scrollContent.css("margin-top", (-1 * (scrollPane.height() - ((scrollPane.height() * ui.value) / 100))) + "px");
} else {
scrollContent.css("margin-top", 0);
}
}
});
});
ui.value / 100 * ( scrollPane.height() - scrollContent.height() )toui.value / 100 * ( scrollPane.height() + scrollContent.height() )(note changing the minus sign to a plus sign)?