<div id="picid" style="VISIBILITY: visible; POSITION: absolute;" onmouseover="clearTimeout(timerid1)" onmouseout="timerid1= 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 isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
var _all = '';
var _style = '';
var wwidth, wheight;
var ydir = '++';
var xdir = '++';
var timerid1, timerid2, timerid3;
var x = 1;
var y = 300;
var x1, y1;
if(!isNS) {
_all='all.';
_style='.style';
}function getwindowsize() {
clearTimeout(timerid1);
clearTimeout(timerid2);
clearTimeout(timerid3);
if (isNS) {
wwidth = window.innerWidth - 220;
wheight = window.innerHeight - 60;
} else {
wwidth = document.body.clientWidth - 220;
wheight = document.body.clientHeight - 60;
}
timerid3 = 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='++';
}
timerid2 = 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 = '++';
}
timerid1 = setTimeout('animate()', 30);
}
var pic1=eval('document.'+_all+'picid'+_style);
window.onload=getwindowsize
window.onresize=getwindowsize
window.onerror = function(){return false}
//  脚本结束 --> 
</script>

解决方案 »

  1.   

    <script language="javascript">
    <!-- Begin
    var IE5=(document.getElementById && document.all)? true : false;
    var W3C=(document.getElementById)? true: false;
    var currIDb=null, currIDs=null, xoff=0, yoff=0; zctr=0; totz=0;
    function trackmouse(evt){
    if((currIDb!=null) && (currIDs!=null)){
    var x=(IE5)? event.clientX+document.body.scrollLeft : evt.pageX;
    var y=(IE5)? event.clientY+document.body.scrollTop : evt.pageY;
    currIDb.style.left=x+xoff+'px';
    currIDs.style.left=x+xoff+10+'px';
    currIDb.style.top=y+yoff+'px';
    currIDs.style.top=y+yoff+10+'px';
    return false;
    }}function stopdrag(){
    currIDb=null;
    currIDs=null;
    NS6bugfix();
    }function grab_id(evt){
    xoff=parseInt(this.IDb.style.left)-((IE5)? event.clientX+document.body.scrollLeft : evt.pageX);
    yoff=parseInt(this.IDb.style.top)-((IE5)? event.clientY+document.body.scrollTop : evt.pageY);
    currIDb=this.IDb;
    currIDs=this.IDs;
    }function NS6bugfix(){
    if(!IE5){
    self.resizeBy(0,1);
    self.resizeBy(0,-1);
    }}function incrzindex(){
    zctr=zctr+2;
    this.subb.style.zIndex=zctr;
    this.subs.style.zIndex=zctr-1;
    }function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){
    if(W3C){
    zctr+=2;
    totz=zctr;
    var txt='<div id=xx style="VISIBILITY: visible; POSITION: absolute;">';
    txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible">&nbsp;</div>';
    txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
    txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5? width-4 : width)+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'">&nbsp;'+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\''+id+'_s\').style.display=\'none\'; document.getElementById(\''+id+'_b\').style.display=\'none\';return false"><img src="closeb.gif" border="0" height="15" width="15"></a></td></tr></table></div></div>';
    txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';">'+text+'</div></div>';
    document.write(txt);
    this.IDh=document.getElementById(id+'_h');
    this.IDh.IDb=document.getElementById(id+'_b');
    this.IDh.IDs=document.getElementById(id+'_s');
    this.IDh.IDb.subs=this.IDh.IDs;
    this.IDh.IDb.subb=this.IDh.IDb;
    this.IDh.IDb.IDov=document.getElementById(id+'_ov');
    if(IE5){
    this.IDh.IDb.IDov.style.width=width-6;
    this.IDh.IDb.IDov.style.height=height-22;
    this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;
    this.IDh.IDb.IDov.style.overflow="auto";
    }else{
    this.IDh.IDs.style.MozOpacity=.5;
    }
    this.IDh.IDb.onmousedown=incrzindex;
    if(isdraggable){
    this.IDh.onmousedown=grab_id;
    this.IDh.onmouseup=stopdrag;
    }}}if(W3C)document.onmousemove=trackmouse;
    if(!IE5 && W3C)window.onload=NS6bugfix;createPopup( 'box3', '标题' ,  288, 90, 275, 155, true, 'FF9966' , '000000' , '800000' , '<a href=http://www.sohu.com>点击查看sohu.com</a><BR><a href=http://www.sina.com.cn>点击查看新浪.com</a>' , 'FFFFFF' , 9 ,'宋体');
    //  End -->
    </script>
    <script language="javascript">
    <!-- 脚本开始
    var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
    var _all = '';
    var _style = '';
    var wwidth, wheight;
    var ydir = '++';
    var xdir = '++';
    var timerid1, timerid2, timerid3;
    var x = 1;
    var y = 300;
    var x1, y1;
    if(!isNS) {
    _all='all.';
    _style='.style';
    }function getwindowsize() {
    clearTimeout(timerid1);
    clearTimeout(timerid2);
    clearTimeout(timerid3);
    if (isNS) {
    wwidth = window.innerWidth - 220;
    wheight = window.innerHeight - 60;
    } else {
    wwidth = document.body.clientWidth - 220;
    wheight = document.body.clientHeight - 60;
    }
    timerid3 = 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='++';
    }
    timerid2 = 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 = '++';
    }
    timerid1 = setTimeout('animate()', 30);
    }
    var pic1=eval('document.'+_all+'xx'+_style);
    window.onload=getwindowsize
    window.onresize=getwindowsize
    window.onerror = function(){return false}
    //  脚本结束 --> 
    </script>
      

  2.   

    哇塞~~net_lover(孟子E章) 老大呀!你出手了,我的问题还叫问题吗?哈哈。。刚刚测试了。你给出的代码是有问题的。
    用来测试的那些字,不在那个窗口内了。
    当窗口往下移动的时候,一直移动到看不见了。倒是文字,是碰到IE边缘就反弹了。
      

  3.   

    <script language="javascript">
    <!-- Begin
    var IE5=(document.getElementById && document.all)? true : false;
    var W3C=(document.getElementById)? true: false;
    var currIDb=null, currIDs=null, xoff=0, yoff=0; zctr=0; totz=0;
    function trackmouse(evt){
    if((currIDb!=null) && (currIDs!=null)){
    var x=(IE5)? event.clientX+document.body.scrollLeft : evt.pageX;
    var y=(IE5)? event.clientY+document.body.scrollTop : evt.pageY;
    currIDb.style.left=x+xoff+'px';
    currIDs.style.left=x+xoff+10+'px';
    currIDb.style.top=y+yoff+'px';
    currIDs.style.top=y+yoff+10+'px';
    return false;
    }}function stopdrag(){
    currIDb=null;
    currIDs=null;
    NS6bugfix();
    }function grab_id(evt){
    xoff=parseInt(this.IDb.style.left)-((IE5)? event.clientX+document.body.scrollLeft : evt.pageX);
    yoff=parseInt(this.IDb.style.top)-((IE5)? event.clientY+document.body.scrollTop : evt.pageY);
    currIDb=this.IDb;
    currIDs=this.IDs;
    }function NS6bugfix(){
    if(!IE5){
    self.resizeBy(0,1);
    self.resizeBy(0,-1);
    }}function incrzindex(){
    zctr=zctr+2;
    this.subb.style.zIndex=zctr;
    this.subs.style.zIndex=zctr-1;
    }function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){
    if(W3C){
    zctr+=2;
    totz=zctr;
    var txt='<div id=xx style="VISIBILITY: visible; POSITION: absolute;border:1px solid red">';
    txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible">&nbsp;</div>';
    txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
    txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5? width-4 : width)+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'">&nbsp;'+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\''+id+'_s\').style.display=\'none\'; document.getElementById(\''+id+'_b\').style.display=\'none\';return false"><img src="closeb.gif" border="0" height="15" width="15"></a></td></tr></table></div></div>';
    txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+'">'+text+'</div></div>';
    document.write(txt);
    this.IDh=document.getElementById(id+'_h');
    this.IDh.IDb=document.getElementById(id+'_b');
    this.IDh.IDs=document.getElementById(id+'_s');
    this.IDh.IDb.subs=this.IDh.IDs;
    this.IDh.IDb.subb=this.IDh.IDb;
    this.IDh.IDb.IDov=document.getElementById(id+'_ov');
    if(IE5){
    this.IDh.IDb.IDov.style.width=width-6;
    this.IDh.IDb.IDov.style.height=height-22;
    this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;
    this.IDh.IDb.IDov.style.overflow="auto";
    }else{
    this.IDh.IDs.style.MozOpacity=.5;
    }
    this.IDh.IDb.onmousedown=incrzindex;
    if(isdraggable){
    this.IDh.onmousedown=grab_id;
    this.IDh.onmouseup=stopdrag;
    }}}if(W3C)document.onmousemove=trackmouse;
    if(!IE5 && W3C)window.onload=NS6bugfix;createPopup( 'box3', '标题' ,  288, 90, 0, 0, true, 'FF9966' , '000000' , '800000' , '<a href=http://www.sohu.com>点击查看sohu.com</a><BR><a href=http://www.sina.com.cn>点击查看新浪.com</a>' , 'FFFFFF' , 9 ,'宋体');
    //  End -->
    </script>
    <script language="javascript">
    <!-- 脚本开始
    var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
    var _all = '';
    var _style = '';
    var wwidth, wheight;
    var ydir = '++';
    var xdir = '++';
    var timerid1, timerid2, timerid3;
    var x = 1;
    var y = 300;
    var x1, y1;
    if(!isNS) {
    _all='all.';
    _style='.style';
    }function getwindowsize() {
    clearTimeout(timerid1);
    clearTimeout(timerid2);
    clearTimeout(timerid3);
    if (isNS) {
    wwidth = window.innerWidth - 220;
    wheight = window.innerHeight - 60;
    } else {
    wwidth = document.body.clientWidth - 220;
    wheight = document.body.clientHeight - 60;
    }
    timerid3 = 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='++';
    }
    timerid2 = 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 = '++';
    }
    timerid1 = setTimeout('animate()', 30);
    }
    var pic1=eval('document.'+_all+'xx'+_style);
    window.onload=getwindowsize
    window.onresize=getwindowsize
    window.onerror = function(){return false}
    //  脚本结束 --> 
    </script>
      

  4.   

    <script language="javascript">
    <!-- Begin
    function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){
    var txt='<div id=xx style="VISIBILITY: visible; POSITION: absolute;border:1px solid red">';
    txt+='<div style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible">&nbsp;</div>';
    txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
    txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+width+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'">&nbsp;'+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\'xx\').style.display=\'none\'; return false"><img src="closeb.gif" border="0" height="15" width="15"></a></td></tr><tr bgcolor="'+ boxcolor +'"><td><div id="'+id+'_ov" style="background-color:'+boxcolor+';margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+'">'+text+'</div></td><td></td></tr></table></div></div>';
    txt+='</div>';
    document.write(txt);
    }
    createPopup( 'box3', '标题' ,  288, 90, 0, 0, true, 'FF9966' , '000000' , '800000' , '<a href=http://www.sohu.com>点击查看sohu.com</a><BR><a href=http://www.sina.com.cn>点击查看新浪.com</a>' , 'FFFFFF' , 9 ,'宋体');
    //  End -->
    </script>
    <script language="javascript">
    <!-- 脚本开始
    var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
    var _all = '';
    var _style = '';
    var wwidth, wheight;
    var ydir = '++';
    var xdir = '++';
    var timerid1, timerid2, timerid3;
    var x = 1;
    var y = 300;
    var x1, y1;
    if(!isNS) {
    _all='all.';
    _style='.style';
    }function getwindowsize() {
    clearTimeout(timerid1);
    clearTimeout(timerid2);
    clearTimeout(timerid3);
    if (isNS) {
    wwidth = window.innerWidth - 220;
    wheight = window.innerHeight - 60;
    } else {
    wwidth = document.body.clientWidth - 220;
    wheight = document.body.clientHeight - 60;
    }
    timerid3 = 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='++';
    }
    timerid2 = 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 = '++';
    }
    timerid1 = setTimeout('animate()', 30);
    }
    var pic1=eval('document.'+_all+'xx'+_style);
    window.onload=getwindowsize
    window.onresize=getwindowsize
    window.onerror = function(){return false}
    //  脚本结束 --> 
    </script>
      

  5.   

    <script language="javascript">
    <!-- Begin
    function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){
    var txt='<div id=xx style="VISIBILITY: visible; POSITION: absolute;border:1px solid red">';
    txt+='<div style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible">&nbsp;</div>';
    txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
    txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+width+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'">&nbsp;'+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\'xx\').style.display=\'none\'; return false"><img src="closeb.gif" border="0" height="15" width="15"></a></td></tr><tr bgcolor="'+ boxcolor +'"><td><div id="'+id+'_ov" style="background-color:'+boxcolor+';margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+'">'+text+'</div></td><td></td></tr></table></div></div>';
    txt+='</div>';
    document.write(txt);
    }
    createPopup( 'box3', '标题' ,  288, 90, 0, 0, true, 'FF9966' , '000000' , '800000' , '<a href=http://www.sohu.com>点击查看sohu.com</a><BR><a href=http://www.sina.com.cn>点击查看新浪.com</a>' , 'FFFFFF' , 9 ,'宋体');
    //  End -->
    </script>
    <script language="javascript">
    <!-- 脚本开始
    var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
    var _all = '';
    var _style = '';
    var wwidth, wheight;
    var ydir = '++';
    var xdir = '++';
    var timerid1, timerid2, timerid3;
    var x = 1;
    var y = 300;
    var x1, y1;
    if(!isNS) {
    _all='all.';
    _style='.style';
    }function getwindowsize() {
    clearTimeout(timerid1);
    clearTimeout(timerid2);
    clearTimeout(timerid3);
    if (isNS) {
    wwidth = window.innerWidth - 308;
    wheight = window.innerHeight - 110;
    } else {
    wwidth = document.body.clientWidth - 308;
    wheight = document.body.clientHeight - 110;
    }
    timerid3 = 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='++';
    }
    timerid2 = 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 = '++';
    }
    timerid1 = setTimeout('animate()', 30);
    }
    var pic1=eval('document.'+_all+'xx'+_style);
    window.onload=getwindowsize
    window.onresize=getwindowsize
    window.onerror = function(){return false}
    //  脚本结束 --> 
    </script>
      

  6.   

    把<SCRIPT src="piao.js"></SCRIPT>piao.js文件如下:bulletin/p.gif为图片的路径和名称,你也可以改成flash等。document.write("<body>");
    document.write("<div id=\"img\" style=\"position:absolute;; left: 27px; top: 1115px\">");
    document.write("<a href='bulletin/041027.asp' target=\"_blank\"><img src=\"bulletin/p.gif\" width=\"203\" height=\"74\" border=0></a>");
    document.write("</div>");
    var xPos = 20;
    var yPos = document.body.clientHeight;
    var step = 1;
    var delay = 30; 
    var height = 0;
    var Hoffset = 0;
    var Woffset = 0;
    var yon = 0;
    var xon = 0;
    var pause = true;
    var interval;
    img.style.top = yPos;
    function changePos() {
    width = document.body.clientWidth;
    height = document.body.clientHeight;
    Hoffset = img.offsetHeight;
    Woffset = img.offsetWidth;
    img.style.left = xPos + document.body.scrollLeft;
    img.style.top = yPos + document.body.scrollTop;
    if (yon) {
    yPos = yPos + step;
    }
    else {
    yPos = yPos - step;
    }
    if (yPos < 0) {
    yon = 1;
    yPos = 0;
    }
    if (yPos >= (height - Hoffset)) {
    yon = 0;
    yPos = (height - Hoffset);
    }
    if (xon) {
    xPos = xPos + step;
    }
    else {
    xPos = xPos - step;
    }
    if (xPos < 0) {
    xon = 1;
    xPos = 0;
    }
    if (xPos >= (width - Woffset)) {
    xon = 0;
    xPos = (width - Woffset);
       }
    }
    function start() {
    img.visibility = "visible";
    interval = setInterval('changePos()', delay);
    }
    start();
    document.write("</body>");
      

  7.   

    把<SCRIPT src="piao.js"></SCRIPT>放到你要漂动的网页中。
      

  8.   

    谢谢 bluemoon0001(小天--五星级的菜鸟) ,你的方法是没用的。因为我这里不是要显示图片或者FLASH什么的。而是N条信息。另外孟子老大的最后的代码,基本没有缺陷了。除了-----我要对那个窗口跟踪追击,才能点到上面的链接。这,总不是很友善吧?
      

  9.   

    增加鼠标支持<script language="javascript">
    <!-- Begin
    function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){
    var txt='<div id=xx onmouseover="clearTimeout(timerid1)" onmouseout="timerid1= setTimeout(\'animate()\', 30);" style="VISIBILITY: visible; POSITION: absolute;border:1px solid red">';
    txt+='<div style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible">&nbsp;</div>';
    txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
    txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+width+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'">&nbsp;'+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\'xx\').style.display=\'none\'; return false"><img src="closeb.gif" border="0" height="15" width="15"></a></td></tr><tr bgcolor="'+ boxcolor +'"><td><div id="'+id+'_ov" style="background-color:'+boxcolor+';margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+'">'+text+'</div></td><td></td></tr></table></div></div>';
    txt+='</div>';
    document.write(txt);
    }
    createPopup( 'box3', '标题' ,  288, 90, 0, 0, true, 'FF9966' , '000000' , '800000' , '<a href=http://www.sohu.com>点击查看sohu.com</a><BR><a href=http://www.sina.com.cn>点击查看新浪.com</a>' , 'FFFFFF' , 9 ,'宋体');
    //  End -->
    </script>
    <script language="javascript">
    <!-- 脚本开始
    var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
    var _all = '';
    var _style = '';
    var wwidth, wheight;
    var ydir = '++';
    var xdir = '++';
    var timerid1, timerid2, timerid3;
    var x = 1;
    var y = 300;
    var x1, y1;
    if(!isNS) {
    _all='all.';
    _style='.style';
    }function getwindowsize() {
    clearTimeout(timerid1);
    clearTimeout(timerid2);
    clearTimeout(timerid3);
    if (isNS) {
    wwidth = window.innerWidth - 308;
    wheight = window.innerHeight - 110;
    } else {
    wwidth = document.body.clientWidth - 308;
    wheight = document.body.clientHeight - 110;
    }
    timerid3 = 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='++';
    }
    timerid2 = 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 = '++';
    }
    timerid1 = setTimeout('animate()', 30);
    }
    var pic1=eval('document.'+_all+'xx'+_style);
    window.onload=getwindowsize
    window.onresize=getwindowsize
    window.onerror = function(){return false}
    //  脚本结束 --> 
    </script>