Scroll scrolling to the specified position triggers the event:
$(function(){
$(Window).Scroll(function() {
Vars =$(Window).ScrollTop();
If(s>=782{//782 is the distance (px) of the navigation bar from the top of the page
$('. Nav '). AddClass(' Fixednav ');
}
else{
$('. Nav '). Removeclass(' Fixednav ');
}
});
});
.fixednav{
PositionFixed
Top0px
Left0px
Width:100%;
Z-index:100000;
_position:absolute;
_top:expression (eval (document). DocumentElement. scrolltop));
}
Click on a button/link to position the page in the specified location:
<Divclass="Nav">
<Ahref="#aaa"> Navigation 1</A>
<Ahref="#bbb">Navigation 2</A>
<Ahref="#ccc">Navigation 3</A>
<A href="#ddd"> navigation 4</a>
</div>
Through the anchor point implementation
<name=id="AAA"></a>
<name=id="BBB"></a>
<name=id="CCC"></a>
<a name=" ddd "id=" ddd "> </a>
&NBSP;
&NBSP;
Scroll scroll to the specified position to trigger the event and click a button/link to position the page in the specified location