怎么在网页插入广告?代码要怎么写?比如我要在网页的左边显示一张图片 他会随着我的鼠标的滚动而滚动,怎么写?id什么的最好举个例子给我 谢谢

解决方案 »

  1.   


    <!doctype html>
    <html>
    <head>
    <meta charset="gb2312" />
    <style>
    body { height:1850px; }
    div {
    position:absolute; top:0px; left:0;
    }
    </style>
    </head>
    <body>
    <div id="test">
    <img src="http://avatar.profile.csdn.net/0/1/6/2_nglwcm.jpg" />
    </div>
    <script>
    function $(o){return document.getElementById(o)}

    window.onscroll = function(){
    $('test').style.top = (document.documentElement.scrollTop || document.body.scrollTop) + 'px' 
    }
    </script>
    </body>
    </html>参考下
      

  2.   

    懒人图库上有一些:
    http://www.lanrentuku.com/js/duilian.html