此作品是浏览网站的时候看到的,觉得很好看、很实用,既有在线客服特效、又有置顶特效,直接可以拿来用,为了方便大家使用,jquery插件代码和css样式代码已经在文件里面了,好好利用哦。。。
首先引用文件
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/contact.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css">
核心代码:
var contachTop = 100; // 右侧联系我们默认高度
function Qust_contachScroll (){
var st = 0;
if (document.documentElement && document.documentElement.scrollTop) {
st = document.documentElement.scrollTop;
} else if (document.body) {
st = document.body.scrollTop;
}
var contactTop = $(".qust_contach").offset().top;
var height = $(".qust_contach").height();
if ( st>80) {
var top = (document.documentElement.clientHeight - height)/2+st -80;
$(".qust_contach").stop().animate(
{
top: top
},300,null,function(){
$("#toTop").stop().animate({
height:45
});
});
} else {
var top = (document.documentElement.clientHeight - height)/2 -80;
//$(".qust_contach").css({
//top: top
//});
if(top<=0)
{
top=contachTop
}
$(".qust_contach").stop().animate(
{
top: top
},300,null,function(){
$("#toTop").stop().animate({
height:0
});
});
}
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791