$location.hash('feature'); $anchorScroll(); 请教各位大神,我用这种方式定义锚点为什么和我定位的id元素有偏差?
See if you have done fixabsolute positioning on banner or topbar. If so, your jump anchor point will definitely not be able to correspond accurately
fix
on
or
SolutionJust set the following code to the container where each id element is located
padding-top:80px; margin-top:-80px
See if you have done
fix
absolute positioningon
banneror
topbar. If so, your jump anchor point will definitely not be able to correspond accurately
Solution
Just set the following code to the container where each id element is located