var marginTop = 0;
var firstTop = 0;
function move() {
scrollTop = (document.body.scrollTop || document.documentElement.scrollTop);
$("#rightDiv").css("margin-top", parseInt(scrollTop) + parseInt(firstTop) + "px");
}
window.onscroll = move;
window.onresize = function() {
scrollTop = (document.body.scrollTop || document.documentElement.scrollTop);
$("#rightDiv").css("margin-top", parseInt(scrollTop) + parseInt(firstTop) + "px");
};
//-->
//关闭按钮
//显示样式
document.writeln("<style type=\"text\/css\">");
document.writeln("#leftDiv,#rightDiv{width:159px;height:400px; z-index:999;position:absolute;}");
document.writeln(".itemFloat{width:159px;height:auto;line-height:5px}");
document.writeln("<\/style>");
//------左侧各块结束
document.writeln("<div id=\"rightDiv\" style=\"top:40px;right:40px\">");
//------右侧各块结束
//---R1
document.writeln("<div id=\"right1\" class=\"itemFloat\">");
document.writeln("<div><img src=\"images/top_01.png\" width=\"159\" height=\"19\" /></div><div style=\"background:url(images/g_05.jpg); padding-left:5px;\"> <a href=\"http://www.izhushen.com/activity/chongzhi1/lingqu.html\"><img src=\"images/lqjhm_01.jpg\" /></a></div>");
document.writeln("<\/div>");
//------右侧各块结束
document.writeln("<\/div>");
一个很好用的滚动跟随广告代码!
最新推荐文章于 2021-06-09 14:42:25 发布