对联广告代码2
<!-- 漂浮 代码 -->
<script language="JavaScript">
var Xpos = 0;
var Ypos = 0;
var Ypos1 = 0;
var Ygravity = 0.9;
var scrollPos = 0;
var oldScrollPos = 0;
function FloatMenu() {
docWidth = -130; // update document width
docWidth1 = 775;
docHeight = document.body.clientHeight; // update document height
oldScrollPos = scrollPos;
scrollPos = document.body.scrollTop; // update scrollbar position
//if(scrollPos > 600) scrollPos = 580;
Xpos = docWidth;
Xpos1 = docWidth1;
Yboundary = scrollPos + 25;
if (floater.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos += 3;
if (floater1.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos1 += 3;
if (floater.offsetTop > Yboundary + 10) // Object is past boundary
Ypos -= 3;
if (floater1.offsetTop > Yboundary + 10) // Object is past boundary
Ypos1 -= 3;
Ypos *= Ygravity; // Slow object down
Ypos1 *= Ygravity; // Slow object down
floater.style.pixelLeft = Xpos + 140;
floater.style.pixelTop += Ypos; // Make object bounce
//floater1.style.pixelLeft = Xpos1 + 116;
floater1.style.pixelRight = 10;
floater1.style.pixelTop += Ypos1; // Make object bounce
}
window.setInterval("FloatMenu()", 30);
</script>
<div id="floater" style="position:absolute; width:90px; height:119px; z-index:1; left: 10px; top: 115px;">
<a href="http://www.m1905.com/cctv6/content_info.asp?nid=11096" target=_blank>
<img src="http://www.m1905.com/live/ad_4.jpg" width=100 height=300 border=0></a></div>
<div id="floater1" style="position:absolute; width:90px; height:119px; z-index:1; right: 10px; top: 115px;">
<a href="http://www.m1905.com/cctv6/content_info.asp?nid=11096" target=_blank>
<img src="http://www.m1905.com/live/ad_4.jpg" width=100 height=300 border=0></a></div>
<script language="JavaScript">
var Xpos = 0;
var Ypos = 0;
var Ypos1 = 0;
var Ygravity = 0.9;
var scrollPos = 0;
var oldScrollPos = 0;
function FloatMenu() {
docWidth = -130; // update document width
docWidth1 = 775;
docHeight = document.body.clientHeight; // update document height
oldScrollPos = scrollPos;
scrollPos = document.body.scrollTop; // update scrollbar position
//if(scrollPos > 600) scrollPos = 580;
Xpos = docWidth;
Xpos1 = docWidth1;
Yboundary = scrollPos + 25;
if (floater.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos += 3;
if (floater1.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos1 += 3;
if (floater.offsetTop > Yboundary + 10) // Object is past boundary
Ypos -= 3;
if (floater1.offsetTop > Yboundary + 10) // Object is past boundary
Ypos1 -= 3;
Ypos *= Ygravity; // Slow object down
Ypos1 *= Ygravity; // Slow object down
floater.style.pixelLeft = Xpos + 140;
floater.style.pixelTop += Ypos; // Make object bounce
//floater1.style.pixelLeft = Xpos1 + 116;
floater1.style.pixelRight = 10;
floater1.style.pixelTop += Ypos1; // Make object bounce
}
window.setInterval("FloatMenu()", 30);
</script>
<div id="floater" style="position:absolute; width:90px; height:119px; z-index:1; left: 10px; top: 115px;">
<a href="http://www.m1905.com/cctv6/content_info.asp?nid=11096" target=_blank>
<img src="http://www.m1905.com/live/ad_4.jpg" width=100 height=300 border=0></a></div>
<div id="floater1" style="position:absolute; width:90px; height:119px; z-index:1; right: 10px; top: 115px;">
<a href="http://www.m1905.com/cctv6/content_info.asp?nid=11096" target=_blank>
<img src="http://www.m1905.com/live/ad_4.jpg" width=100 height=300 border=0></a></div>