首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

简略的对联广告

2012-10-07 
简单的对联广告htmlheadtitle对联广告/titlestylebody{height:2000px}.dui{width:100pxheight

简单的对联广告

<html>
    <head><title>对联广告</title>
        <style>
         body{
           height:2000px;
       
         }      
             .dui{
             width:100px;
             height:400px;
             border:1px solid red;
         }  
         #left{
             float:left;
             overflow:hidden;
             position:relative;
             background:url('left_ad.jpg')
         }
         #right{
             float:right;
             position:relative;
             background:url('right_ad.jpg')
         }
        .fix{
        
           position:fixed;
           top:150px;     
       }
        </style>
    </head>
    <body>
        <script src='jquery-1.4.2.min.js'></script>
        <script>
                  jQuery(document).ready(function(jquery){
              jquery(window).scroll(function (){
            var to=jquery('.fix').offset().top;
            jquery('.dui').animate({
             top:to+'px'
            },'200');         
        });
    });
        </script>
      
        <div id='left' class='dui'>
             <div class='fix'></div>
        </div> 
                <div id='right' class='dui'></div>
    </body>
</html>

[/html]

热点排行