简单的对联广告

<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]

发表评论

电子邮件地址不会被公开。 必填项已用*标注