Scroll to anchor with fixed header, content hidden behind header, margin and top padding not working

前端 未结 3 1655
小鲜肉
小鲜肉 2020-12-15 12:16

I\'m using smoothscroll.js to navigate my site. It stops on the correct anchor in Firefox, however in Chrome it passes the point on the first click of the link, and pushes t

相关标签:
3条回答
  • 2020-12-15 12:34

    This may be due to a new wordpress theme using the header html5 element. I changed my header to a div, and it worked fine.

    0 讨论(0)
  • 2020-12-15 12:48

    SOLVED: http://nicolasgallagher.com/jump-links-and-viewport-positioning/demo/#method-D

    There are several methods available.

    0 讨论(0)
  • 2020-12-15 12:50

    I used Local Scroll (JQuery) to do this.

    It allows you to do a top offset

    $.localScroll({
        offset: -100
    });
    
    0 讨论(0)
提交回复
热议问题