Set & amp; lt; header & amp; gt; in html; that is to say, there is a small button on it (which should be common to our predecessors) that uses the aherf & quot; # id & quot; anchor for page shifting, however, clicking the link anchor will bring the page to "TOP", that is, some of them will be... settings in html
That is to say, there is a "small button" on it (which should be common to the predecessors)
Usea herf="#id"Click the link to take the page to the top of the page. That is to say, some of the pages are replaced by the header.
How can I move down some of the jump anchor points?
Similar to this
Http://segmentfault.com/q/1010000000124208
However, my p id is generated, and of course I have tried some js
$(function(){ if(location.hash){ var target = $(location.hash); if(target.length==1){ var top = target.offset().top-100; if(top > 0){ $('html,body').animate({scrollTop:top}, 1000); } } } });
Big Solution
1201 modify hmtl as follows
- My greatest region in the world
- 36588 Systems
- Other systems
My greatest region in the world
Reply content:
Settings in html
That is to say, there is a "small button" on it (which should be common to the predecessors)
Usea herf="#id"Click the link to take the page to the top of the page. That is to say, some of the pages are replaced by the header.
How can I move down some of the jump anchor points?
Similar to this
Http://segmentfault.com/q/1010000000124208
However, my p id is generated, and of course I have tried some js
$(function(){ if(location.hash){ var target = $(location.hash); if(target.length==1){ var top = target.offset().top-100; if(top > 0){ $('html,body').animate({scrollTop:top}, 1000); } } } });
Big Solution
1201 modify hmtl as follows
- My greatest region in the world
- 36588 Systems
- Other systems
My greatest region in the world
If you want to offset it to the following, you can only use js.
I checked the friend's method on the first floor and changed the style of his span tag,
.placeholder{display:block; width:100px; height:50px; margin-top:-50px; }
Js-free implementation.
Welcome.
Useposition:absolute;The method of discontinuing from the Document Stream changes the position of the anchor without affecting the presentation.
Http://jsbin.com/teqisuve/5/
PS. Adoption of updates downstairs
Do not jump to the element you want, set an empty element on it, jump to that