增加一个js函数

This commit is contained in:
2016-07-04 00:25:21 +08:00
parent 2da74dbc1e
commit f3fff63632

View File

@@ -329,4 +329,19 @@ $(function() {
}
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");
}
}