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

XF 1.4 Jump to post

Discussion in 'Styling and Customization Questions' started by BassMan, Sep 9, 2014.

  1. BassMan

    BassMan Well-Known Member

    When you click on a link to a certain post, at the end of the url you'll see for example like that: #post-7

    That post you can see on the top of the page.

    How can I lower that position to see a little bit of previous post?
  2. RoldanLT

    RoldanLT Well-Known Member

    Because your using static navigation?
  3. BassMan

    BassMan Well-Known Member

    Yes, don't know where to edit this.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I'm not sure I understand. Can you be more specific?
  5. AndyB

    AndyB Well-Known Member

    Anchors are used which are in the HTML. The browser will always scroll to the anchor, so there's no way to change the scrolling point without moving the anchor point and that's not going to really be possible.
    BassMan likes this.
  6. RoldanLT

    RoldanLT Well-Known Member

    Premium style creator such as Audentio, Arty has a workaround for this :)
    I think it's via JavaScript.
  7. BassMan

    BassMan Well-Known Member

    I mean when you go directly to post like this:

    ... how can I move tha anchor a bit down to show like this for same post:
  8. BassMan

    BassMan Well-Known Member

    I hope it can be done :confused:

    Thanks for that info.
  9. Arty

    Arty Well-Known Member

    It requires some JS. Try something like this:
    var $w = $(window);
    $w.on('load hashchange', function() {
          var hash = (window.location.hash) ? window.location.hash : '';
           if (!hash) return;
           window.scrollTo($w.scrollLeft(), $w.scrollTop() - 50);
    In proper code you'd need some additional checks, like checking height of your navigation block and checking if static navigation is even enabled. But that should do.
    Mirovinger, RoldanLT and BassMan like this.

Share This Page