绵阳整形美容医院抖动窗口关键函数
2012-09-04 12:49:56
var suspendcode='<DIV id="lovexin1" style="Z-INDEX: 1000000; position:fixed;right: 0px; bottom: 0px; width: 214px; height: 124px;cursor:pointer;display:none;">'+"<a id=\"qqShake\" href=
http://www.mianmei.cn >"+'<img src="/doudong.gif" width="214" height="124" border="0" />'+'</a>' +'</DIV>'
document.write(suspendcode);
$(document).ready(function(){
$('#lovexin1').css('display','block');
FollowDiv = {
follow : function(){
$('#lovexin1').css('position','absolute');
$(window).scroll(function(){
var f_top = $(window).scrollTop() + $(window).height() - $("#lovexin1").outerHeight();
$('#lovexin1').css( 'top' , f_top );
});
}
}
if($.browser.msie && $.browser.version == 6) {
FollowDiv.follow();
}
shake();
repeat = setInterval(shake,10000);//这里repeat是全局,在hideLovexin1函数中清空
//绑定点击事件
});
function hideLovexin1()
{
$('#lovexin1').css('display','none');
window.setTimeout("show_doudong()",40000);
//clearInterval(repeat);
}
function shake(){
//window.console.log('shake')
var a=['bottom','right'],b=0;
var u=setInterval(function(){
$('#lovexin1').css( a[b%2] , (b++)%4<2?0:4 );
if(b>17){
clearInterval(u);
b=0;
}
},30)
}
function show_doudong()
{
$('#lovexin1').css('display','block');
}