jquery scrollpane and scrollTo at same time
Current demo here: http://www.studioimbrue.com/sites/eliotdudik
I have the tabs system working wonderfully. I'm trying to get it so that if you're down a ways on the gallery and then click "foreword" or any menu item, it scrolls you back to 0,0.
The current sliding code is as follows:
$('#wrapper ul li').click(function() {
$(window).scrollTo($(this).next('li'), 500, {offset: {top:0, left:-50}}, {easing:'easeOutExpo'} );
});
开发者_如何学GoAnd I'm trying to add something like this under it:
$('#menu li').click(function() {
$(window).scrollTo(0,0, 500, {offset: {top:0, left:-50}}, {easing:'easeOutExpo'} );
});
It continues switching tabs, but it won't scroll back to the beginning!
The click events are not being delegated into the li
elements. You have to target the a
(anchor) elements instead. So here goes:
$('#menu li a').click(function() {
$(window).scrollTo(0,0, 500, {offset: {top:0, left:-50}}, {easing:'easeOutExpo'} );
});
精彩评论