<div id="__ID_104E42D93FC" style="VISIBILITY: visible; POSITION: absolute;" onmouseover="clearTimeout(ID1_104E42D93FC)" onmouseout="ID1_104E42D93FC = setTimeout('animate()', 30);"><a href="http://dotnet.aspx.cc/" target=blank )"><img src="http://dotnet.aspx.cc/Images/logoSite.gif"  border="0"></a></div>
<!-- 此行为注释:可以全部删除。以下不要动,如果修改图片或者链接,只需要修改上面的HTML部分即可 -->
<script language="javascript">
<!-- 脚本开始
var divWidth = 220
var divHeight = 60
var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
var _all = '';
var _style = '';
var wwidth, wheight;
var ydir = '++';
var xdir = '++';
var ID1_104E42D93FC, ID2_104E42D93FC, ID3_104E42D93FC;
var x = 1;
var y = 300;
var x1, y1;
if(!isNS) {
_all='all.';
_style='.style';
}function getwindowsize() {
clearTimeout(ID1_104E42D93FC);
clearTimeout(ID2_104E42D93FC);
clearTimeout(ID3_104E42D93FC);
if (isNS) {
wwidth = window.innerWidth - divWidth;
wheight = window.innerHeight - divHeight;
} else {
wwidth = document.body.clientWidth - divWidth;
wheight = document.body.clientHeight - divHeight;
}
ID3_104E42D93FC = setTimeout('randomdir()', 20000);
animate();
}function randomdir() {
if (Math.floor(Math.random()*2)) {
(Math.floor(Math.random()*2)) ? xdir='--': xdir='++';
} else {
(Math.floor(Math.random()*2)) ? ydir='--': ydir='++';
}
ID2_104E42D93FC = setTimeout('randomdir()', 20000);
}function animate() {
eval('x'+xdir);
eval('y'+ydir);
if (isNS) {
pic1.moveTo((x+pageXOffset),(y+pageYOffset))
} else {
pic1.pixelLeft = x+document.body.scrollLeft;
pic1.pixelTop = y+document.body.scrollTop;
}
if (isNS) {
if (pic1.top <= 5+pageYOffset) ydir = '++';
if (pic1.top >= wheight+pageYOffset) ydir = '--';
if (pic1.left >= wwidth+pageXOffset) xdir = '--';
if (pic1.left <= 5+pageXOffset) xdir = '++';
} else {
if (pic1.pixelTop <= 5+document.body.scrollTop) ydir = '++';
if (pic1.pixelTop >= wheight+document.body.scrollTop) ydir = '--';
if (pic1.pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--';
if (pic1.pixelLeft <= 5+document.body.scrollLeft) xdir = '++';
}
ID1_104E42D93FC = setTimeout('animate()', 30);
}
var pic1=eval('document.'+_all+'__ID_104E42D93FC'+_style);
window.onload=getwindowsize
window.onresize=getwindowsize
window.onerror = function(){return false}
//  脚本结束 --> 
</script>

解决方案 »

  1.   

    <script language=JavaScript type=text/JavaScript>
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //设置广告块
    var divLeft=0;//设置广告块初始左边位置
    var divTop=0;//设置广告块初始顶部位置
    var divWidth=90;//设置广告块宽度
    var divHeight=120;//设置广告块高度
    var divImg="ad1.gif";//设置广告图片的URL地址
    var divUrl="../shop/pop0.htm";//设置广告链接
    var divTitle="xxxxx";
    document.write("<DIV id=\"adDiv\" style=\"position:absolute; left:"+divLeft);
    document.write("px; top:"+divTop+"px; width:"+divWidth+"px; height:"+divHeight);
    document.write("px; z-index:1;\" onMouseOver=\"javascript:window.clearInterval(varId)\"");
    document.write(" onMouseOut=\"javascript:beginMoveAd();\"><a target=\"_blank\" href=\""+divUrl+"\">");
    document.write("<img src=\""+divImg+"\" border=\"0\" alt=\""+divTitle+"\"></a></DIV>")
    //飘浮广告
    var _stepx=2;_stepy=2;
    var moveSpeed=50;
    var varId;
    function moveAd(){
    var adLeft=parseInt(adDiv.style.left);
    var adTop=parseInt(adDiv.style.top);
    var adWidth=parseInt(adDiv.style.width);
    var adHeight=parseInt(adDiv.style.height)
    var _bodyLeft=document.body.scrollLeft;
    var _bodyTop=document.body.scrollTop;
    var _bodyHeight=document.body.clientHeight+_bodyTop;
    var _bodyWidth=document.body.clientWidth+_bodyLeft;
    if(adLeft<=_bodyLeft){
    _stepx=2;
    }
    if(adTop<=_bodyTop){
    _stepy=2;
    }
    if((adLeft+adWidth)>=_bodyWidth){
    _stepx=-2
    }
    if((adTop+adHeight)>=_bodyHeight){
    _stepy=-2
    }
    adDiv.style.left=adLeft+_stepx;
    adDiv.style.top=adTop+_stepy;
    }
    function beginMoveAd(){
    varId=window.setInterval("moveAd()",moveSpeed)
    }
    window.onload=beginMoveAd;//-->
    </script>
      

  2.   

    function floaters() {
    this.items = [];
    this.addItem = function(id,x,y,content)
      {
    document.write('<DIV id='+id+' style="Z-INDEX:80; POSITION: absolute;  width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');

    var newItem = {};
    newItem.object = document.getElementById(id);
    newItem.x = x;
    newItem.y = y; this.items[this.items.length] = newItem;
      }
    this.play = function()
      {
    collection = this.items
    setInterval('play()',100);
      }
    }
    function play()
    {
    for(var i=0;i<collection.length;i++)
    {
    var followObj = collection[i].object;
    var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
    var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y); if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
    var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
    dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
    followObj.style.left=followObj.offsetLeft+dx;
    } if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
    var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
    dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
    followObj.style.top=followObj.offsetTop+dy;
    }
    }
    }

    var theFloaters = new floaters();
    //theFloaters.addItem('followDiv3','20',320,'<a href="/ad_count.php?ad_name=zq5988" target="_blank"><img src="/images/ad/zq5988_60x80.gif" width="60" height="80" border="0"></a>'); //theFloaters.addItem('followDiv4','document.body.clientWidth-82',220,'<a href="/ad_count.php?ad_name=xc2008" target="_blank"><img src="/images/ad/xc2008_60x80.gif" width="60" height="80" border="0"></a>');
    theFloaters.play();