Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
397 views
in Technique[技术] by (71.8m points)

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

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 the content to the top, hiding the content behind the page. then if you click it again, it aligns correctly. I've seen the problems on other sites as well. Curious to see if others have the same problem. Chrome seems to ignore any top padding or margin or positioning (example: top:20%;).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...