jquery 文字(動態消息)向上滾動一次一行

   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">   javascript

   <html>   css

       <head>   html

           <meta http-equiv="Content-Type" content="text/html; charset=utf-8">   java

           <title>Untitled Document</title>   jquery

       <style type="text/css">   ajax

           .list,li{list-style:none; margin:0; padding:0;}   api

           .scroll{ width:500px; height:25px; overflow:hidden; border:1px solid #333;}   app

           .scroll li{ width:500px; height:25px; line-height:25px; overflow:hidden;}   ui

           .scroll li a{ font-size:14px;color:#333; text-decoration:none;}   this

           .scroll li a:hover{ text-decoration:underline;}  

       </style>  

       <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>  

       </head>  

       <body>  

           <div class="scroll">  

               <ul class="list">  

                   <li><a href="#" target="_blank">sdfsdfsdf </a></li>  

                   <li><a href="#" target="_blank">rtyrt rty rtyrt r</a></li>  

               </ul>  

           </div>  

           <script>

                   function autoScroll(obj){  

                       $(obj).find(".list").animate({  

                           marginTop : "-25px"  

                       },500,function(){  

                           $(this).css({marginTop : "0px"}).find("li:first").appendTo(this);  

                       })  

                   }  

                   $(function(){  

                       setInterval('autoScroll(".scroll")',3000)  

                   })  

           </script>

       </body>  

   </html>  

相關文章
相關標籤/搜索