就是div层的显示与否,已经位置的控制和内容的添加而已。
前面都是通过style属性来控制,后者你应该知道怎么作吧。
如果你是用DW,里面有实例代码的。

解决方案 »

  1.   

    xdspower() ,谢谢你的回答,可是如何把div设置成浮动的呢?huo789(四火),谢谢你的回答,你说的JSLinb下载了一个好象是js文件的东西,无法使用.
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
    <head>
    <title>movebypath</title>
    </head>
    <script language="JavaScript">
    var winWidth,winHeight,theLeft,theTop,theImg;
    var xFlag = 1,yFlag = 1;
    var xStep = 2,yStep = 1;
    function movePic()
    {
    ifNN4=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4);
    ifNN6=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==5);
    if(ifNN4)
    theImg = document.img1;
    else
    theImg = document.getElementById("img1").style;
    if(ifNN4||ifNN6)
    {
    winWidth = window.innerWidth;
    winHeight = window.innerHeight;
    }
    else
    {
    winWidth = document.body.clientWidth;
    winHeight = document.body.clientHeight;
    }
    theLeft = parseInt(theImg.left);
    theTop = parseInt(theImg.top);
    if(theLeft<=0)
    xFlag = 1;
    if(theLeft+120>=winWidth)
    xFlag = -1;
    if(theTop<=0)
    yFlag = 1;
    if(theTop+60>=winHeight)
    yFlag = -1;
    theImg.left = theLeft+xFlag*xStep;
    theImg.top = theTop+yFlag*yStep;
    setTimeout("movePic()",50);
    }
    </script>
    <body onload="movePic()">
    <div id="img1" style="position:absolute;left:0px;top:0px;width=120px;height=60px;z-index:2">
    <a href="10-2.html"><img border="0" src="pic1.gif"></a>
    </div>
    </body>
    </html>
      

  3.   

    ie8.0的消息都出来了?
    position:absolute;设置top和left这样就可以随意的放到自己想放的地方。
      

  4.   

    其实所谓浮动就是相对与不浮动,这个是有div所在的Z轴定义和相互重叠产生的效果,如果大家都是一个层,一般就认为不能互相重叠,这样就没有浮动的效果了。