jquery - Scrolling div using scrolltop() and div position.top only working correctly once, then strangely -
i'm making scroller website, using fixed div navigation, , wrapper div part scrolled using .scrolltop on nav click handlers.
it working if click links first time after refresh, subsequent use of nav sends scroll random positions.
i'm thinking might have fact using wrapper , not using scrolltop directly on 'html, body'?
the click handlers i'm using nav buttons this:
$('#mylink3').click(function() { $('#wrapper').animate({scrolltop: $('#environment3').position().top}, 1000); });
the test site here:
http://testbed.shottotheface.org.
thanks help! i'm going cross eyed on 1 , feels should such simple answer.
cooper
[edit]
i tried removing #wrapper , using click handler this:
$('#mylink2').click(function() {$('body, html').animate({scrolltop: $('#environment2').offset().top}, 1000); });
but don't seem having luck..? tried .offset #wrapper earlier today... still doing wrong?
Comments
Post a Comment