See http://www.mszte.hu/ on chrome, ff. When you scrolling down, everything works as expected, but during scrolling up, there is a small back jump. I'm not a jquery ninja, have somebody any idea what is wrong?

Comments

seandunaway’s picture

What should I click to scroll up on your site?

Courtney.B’s picture

Maybe it's something that you could use ScrollTo to implement.

I'm not a programmer but I found this webpage when I was looking for LocalScroll tutorials. It's actually a tutorial on using ScrollTo to control easing vertically.

http://www.webdesignerwall.com/demo/scrollto-demo/

This example uses a "Previous" and "Next" buttons to control the navigation from section to section. Maybe with a little modification, it could solve this issue?

Please note, I did not write the code below. It's copied and pasted from the example site linked to above.

<script type="text/javascript">
$(function() {

    function scroll(direction) {

        var scroll, i,
                positions = [],
                here = $(window).scrollTop(),
                collection = $('.post');

        collection.each(function() {
            positions.push(parseInt($(this).offset()['top'],10));
        });

        for(i = 0; i < positions.length; i++) {
            if (direction == 'next' && positions[i] > here) { scroll = collection.get(i); break; }
            if (direction == 'prev' && i > 0 && positions[i] >= here) { scroll = collection.get(i-1); break; }
        }

        if (scroll) {
            $.scrollTo(scroll, {
                duration: 750       
            });
        }

        return false;
    }

    $("#next,#prev").click(function() {        
        return scroll($(this).attr('id'));        
    });

    $(".scrolltoanchor").click(function() {
        $.scrollTo($($(this).attr("href")), {
            duration: 750
        });
        return false;
    });

});
</script>
joshuautley’s picture

I'm using FF and when I click on the menu which causes the page to scroll up I don't get this error.

It's been a year. Could it be that FF fixed something in their browser?

hanskuiters’s picture

Issue summary: View changes

FF didn't fix it. I think the offset setting is related to this problem. If offset is set to 0, there is hardly a jump. If offset is set to a bigger number, I need -275, the jump is huge. Maybe thsi helps to debug.