$location.hash('feature');
$anchorScroll();
请教各位大神,我用这种方式定义锚点为什么和我定位的id元素有偏差?
PHP中文网2017-05-27 17:46:29
See if you have done fix
absolute positioning on
banner or
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
padding-top:80px;
margin-top:-80px