增加一个js函数
This commit is contained in:
@@ -330,3 +330,18 @@ $(function() {
|
|||||||
msg.show();
|
msg.show();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 置顶函数
|
||||||
|
* @param {[type]} obj [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
function go_to_top(obj){
|
||||||
|
var scrTop = $(window).scrollTop();
|
||||||
|
var windowTop = $(window).height();
|
||||||
|
if ((windowTop-300)<scrTop){
|
||||||
|
$("#"+obj).fadeIn("slow");
|
||||||
|
}else{
|
||||||
|
$("#"+obj).fadeOut("slow");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user