3

Right now I am using a ScrollTo plugin as demonstrated in this fiddle. If you press the back/next button it will scroll you to the next post. The problem is that I have a fixed navigation bar and it blocks the posts. I did some research, both here and on the plugin author's blog and I learnt that you have to add an "offset" option. So I turned this

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

into

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

However this just breaks the plugin and it stops working comepletely. I tried some other options as suggested by related posts but none of the methods worked.

/Tony

1 Answer 1

1

You need a comma between offset and duration

offset: -50,
duration: 750

I notice it works with 50, but with -50 you need to first scroll down a little. Needs a bit more work ;)

Sign up to request clarification or add additional context in comments.

1 Comment

Didn't solve the problem but the offset did work now ) thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.