两侧跟随广告

 1 <!DOCTYPE html>
 2 <html>
 3 <head lang="en">
 4     <meta charset="UTF-8">
 5     <title></title>
 6     <style type="text/css">
 7         .left,.right{
 8             position: absolute;
 9             top:80px;
10         }
11         .left{
12             left: 0;
13         }
14         .right{
15             right: 0;
16         }
17     </style>
18     <script type="text/javascript" src="../jquery-1.11.1.min.js"></script>
19     <script type="text/javascript">
20         $(function(){
21             $(window).scroll(function () {
22                 var scrollTop = $(document).scrollTop();
23 
24                 $(".left,.right").stop().animate({"top" : scrollTop + 50},600);
25             });
26         });
27     </script>
28 </head>
29 <body>
30     <div class="left"><img src="images/1.gif" alt=""/></div>
31     <div class="right"><img src="images/2.gif" alt=""/></div>
32     <p>我们的开始,是很长的电影</p>
33     <p>我们的开始,是很长的电影</p>
34   
35 </body>
36 </html>

 

posted @ 2018-01-01 22:48  前端极客  阅读(316)  评论(0编辑  收藏  举报