<html>
<head>
<title>kk</title>
</head>
<BODY onclick="begin()">
<div id="div1" style="position:absolute;left:10;top:100;background-color:#ffffff">
<p align=center>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="160" height="80">
                                      <param name=movie value="http://www.china-zjj.com/images/xxzw.swf">
                                      <param name=wmode value="transparent">
                                      <embed src="http://www.china-zjj.com/images/xxzw.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="160" height="80">
                                      </embed> 
                                    </object></div></BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
var v_step, h_step;
v_step = 10 // 移动步长 横向 纵向
h_step = 10
var i = 9
var SCREEN_WIDTH = 640 // 屏幕 宽度 高度
var SCREEN_HEIGHT= 480function begin()
{
window.setInterval("mov()",500)
}function mov()
{
var lft = document.all.item("div1").style.left
var tp  = document.all.item("div1").style.topvar newlft 
newlft = parseInt(erase_px(lft)) + h_step var newtop 
newtop = parseInt(erase_px(tp)) + v_stepdocument.all.item("div1").style.left = newlft
document.all.item("div1").style.top  = newtop if( (newlft>SCREEN_WIDTH)||(newlft<=0) )
h_step = -h_step if( (newtop>SCREEN_HEIGHT)||(newtop<=0) )
v_step = -v_step}function erase_px(px)
{
// 删除 层单位中的 px
var ln 
ln = px.lengthreturn px.substr(0, ln-2)}
//-->
</SCRIPT>
</body>
</html>

解决方案 »

  1.   


     飘浮的图片 
      
    提示:广告经常用的. 
    1.将下面的代码复制到<body>内 
    <div id="point1" STYLE="position:absolute;visibility:visible;">
    <!--Please delete this table and insert into your html elements-->
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <a href="../../../www.dynamicdrive.com/index.html">
    <img src="../ddaward.gif" width=96 height=60 alt="" border="0">
    </a>
    </td>
    </tr>
    <tr>
    <td>
    <center><a href="../../../www.dynamicdrive.com/index.html">
    <font face="Arial" size="2" color="#0000FF">Dynamic Drive</font>
    </a></center>
    </td>
    </tr>
    <tr>
    <td>
    <center><a href="../../../www.dynamicdrive.com/new.htm">
    <font face="Arial" size="2" color="#0000FF">What's New</font>
    </a></center>
    </td>
    </tr>
    </table>
    <!--End of the customizable area, please do not delete div the tag -->
    </div>
    <script LANGUAGE="JavaScript1.2">/*
    Floating image II (up down)- Bruce Anderson (http://appletlib.tripod.com)
    Submitted to Dynamicdrive.com to feature script in archive
    Modified by DD for script to function in NS6
    For 100's of FREE DHTML scripts, Visit http://www.dynamicdrive.com
    */var XX=20; // X position of the scrolling objects
    var xstep=1;
    var delay_time=60;//Begin of the unchangable area, please do not modify this area
    var YY=0;  
    var ch=0;
    var oh=0;
    var yon=0;var ns4=document.layers?1:0
    var ie=document.all?1:0
    var ns6=document.getElementById&&!document.all?1:0if(ie){
    YY=document.body.clientHeight;
    point1.style.top=YY;
    }
    else if (ns4){
    YY=window.innerHeight;
    document.point1.pageY=YY;
    document.point1.visibility="hidden";
    }
    else if (ns6){
    YY=window.innerHeight
    document.getElementById('point1').style.top=YY
    }
    function reloc1()
    {if(yon==0){YY=YY-xstep;}
    else{YY=YY+xstep;}
    if (ie){
    ch=document.body.clientHeight;
    oh=point1.offsetHeight;
    }
    else if (ns4){
    ch=window.innerHeight;
    oh=document.point1.clip.height;
    }
    else if (ns6){
    ch=window.innerHeight
    oh=document.getElementById("point1").offsetHeight
    }

    if(YY<0){yon=1;YY=0;}
    if(YY>=(ch-oh)){yon=0;YY=(ch-oh);}
    if(ie){
    point1.style.left=XX;
    point1.style.top=YY+document.body.scrollTop;
    }
    else if (ns4){
    document.point1.pageX=XX;
    document.point1.pageY=YY+window.pageYOffset;
    }
    else if (ns6){
    document.getElementById("point1").style.left=XX
    document.getElementById("point1").style.top=YY+window.pageYOffset
    }}function onad()
    {
    if(ns4)
    document.point1.visibility="visible";
    loopfunc();
    }
    function loopfunc()
    {
    reloc1();
    setTimeout('loopfunc()',delay_time);
    }if (ie||ns4||ns6)
    window.onload=onad</script>
      2.请按Script内的指示按你的需要修改,我已把重点部分翻译了。还有不明白的地方请到论坛发表。