// Scroll to the id of the specified element, for example, $ ("# Exam82 ")
Function Jump (){
Var scroll_offset = $ ("# Exam82"). offset (); // obtain the offset of the div layer Exam82, which contains two values: top and left.
$ ("Body, html"). animate ({
ScrollTop: scroll_offset.top // make the scrollTop of the body equal to the top of Exam82, so that the scrolling is realized.
}, 2000); // 2000 controls the scroll speed}
// The element is automatically loaded when it appears in the browser display area.
Function autoloading (){
// Obtain the distance from $ ("# Exam86") to the top ($ ("# Exam86 "). offset (). top)-the height of the area displayed in the browser ($ (window ). height ())
Var totalheight = parseFloat ($ ("# Exam86"). offset (). top)-parseFloat ($ (window). height ());
// Obtain the vertical height from the scroll bar to the top:
Var guen = $ (document). scrollTop ();
If (parseInt (totalheight) <parseInt (guen )){
Alert ("loading... ");
}
}