Ascensor.js
Ascensor.js copied to clipboard
Scroll Top
How would you scroll to the top of a certain Ascensor page?
I've tried both window.scrollTo(0,0);
&& $(div).scrollTop();
Neither work though, understandably, since the actual x, y scroll positions are not 0, 0 for each page
I'm not sure exactly what you mean? Could you explain a bit more why you trying to do?
You talk about "go-to-top" link?
/ HTML / <a class="start-over" href="#">Top</a>
/ Script /
var ascensor = $('#content').ascensor(); var ascensorInstance = $('#content').data('ascensor');
$(".start-over").click(function() { ascensorInstance.scrollToFloor(0); });
what about
var ascensor = $('#content').ascensor();
$(".start-over").click(function() {
ascensor.trigger("scrollToStage", 0);
})
?