Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll Top #65

Open
Ponyboy47 opened this issue Dec 23, 2014 · 3 comments
Open

Scroll Top #65

Ponyboy47 opened this issue Dec 23, 2014 · 3 comments
Labels

Comments

@Ponyboy47
Copy link

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

@kirkas
Copy link
Owner

kirkas commented Mar 29, 2015

I'm not sure exactly what you mean? Could you explain a bit more why you trying to do?

@kirkas kirkas added the unclear label Mar 29, 2015
@kiriniy
Copy link

kiriniy commented Apr 1, 2015

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);
});

@kirkas
Copy link
Owner

kirkas commented Apr 1, 2015

what about

var ascensor = $('#content').ascensor();
$(".start-over").click(function() {
    ascensor.trigger("scrollToStage", 0);
})

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants