1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 How to fix incorrect anchor positions because of sticky header?

Discussion in 'Styling and Customization Questions' started by Stuart Wright, Sep 17, 2014.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    When a site has a sticky header (like AVForums), the desired position of an anchor becomes offset by the height of the stuck header.
    So scrolling to a particular post in a thread (like when a member opens a thread and it scrolls to the first new post since they last visited), actually scrolls too far down.
    Illustrated here. When scrolling to post #5668, we want to see this:


    But what we actually see is


    How can I fix this please?
  2. szymme

    szymme Member

    Needed 3 Hours to solve this problem :D

    Add this Javascript Code in Header:

    Thats all, with "top-95" you can choose the position you need.
  3. Stuart Wright

    Stuart Wright Well-Known Member

    Thank you, but it throws a javascript error when clicking a link in a page. The error vanishes too fast for me to read it.

Share This Page