基于jQuery實(shí)現(xiàn)的單行公告活動(dòng)輪播效果
廢話不多說(shuō)了,直接給大家貼代碼了,具體代碼如下所示:
<div class="lunbo123" style="position:relative;height: 45px;overflow: hidden;background-color:white" ;> <ul id="myul" style="margin:6px;padding:0px;position:absolute;width: 700px; height: auto;"> <li> <a href="" style=" rel="external nofollow" rel="external nofollow" text-decoration: none;color: #000000; "> <span style="height:36px ; line-height: 36px;">公告test1 </span> </a> </br> </li> <li> <a href="" style=" rel="external nofollow" rel="external nofollow" text-decoration: none;color: #000000; "> <span style="height:36px ; line-height: 36px;">活動(dòng)test2 </span> </a> </br> </li> </ul> </div> <script src="http://cdn.bootcss.com/jquery/2.2.2/jquery.js"></script> <script> function lunbo123(id, height) { var ul = $(id); var liFirst = ul.find('li:first'); $(id).animate({ top: height }).animate({ "top": 0 }, 0, function() { var clone = liFirst.clone(); $(id).append(clone); liFirst.remove(); }) } setInterval("lunbo123('#myul','-45px')", 2500) </script> <style> #myul { list-style-type: none; width: 300px; height: 45px; font-size: 20px; } </style>
總結(jié)
以上所述是小編給大家介紹的基于jQuery實(shí)現(xiàn)的單行公告活動(dòng)輪播效果,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
jQuery實(shí)現(xiàn)簡(jiǎn)單全選框
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)簡(jiǎn)單全選框,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-09-09基于jQuery的實(shí)現(xiàn)簡(jiǎn)單的分頁(yè)控件
分頁(yè)控件需要向后臺(tái)發(fā)送請(qǐng)求,發(fā)送的參數(shù)包括當(dāng)前頁(yè),每頁(yè)顯示數(shù)量,查詢條件;并且獲取數(shù)據(jù)加載到當(dāng)前頁(yè)面2010-10-10jQuery的Scrollify插件實(shí)現(xiàn)滑動(dòng)到頁(yè)面下一節(jié)點(diǎn)
這篇文章主要介紹了jQuery的Scrollify插件實(shí)現(xiàn)滑動(dòng)到頁(yè)面下一節(jié)點(diǎn)的相關(guān)資料,需要的朋友可以參考下2015-07-07修改或擴(kuò)展jQuery原生方法的代碼實(shí)例
這篇文章主要介紹了修改或擴(kuò)展jQuery原生方法的代碼實(shí)例,本文用一個(gè)擴(kuò)展jquery原生方法val的例子,講解了如何對(duì)jquery原生方法修改或擴(kuò)展,需要的朋友可以參考下2015-01-01jQuery實(shí)現(xiàn)左右切換焦點(diǎn)圖
這篇文章主要介紹了jQuery實(shí)現(xiàn)左右切換焦點(diǎn)圖的核心代碼,有需要的小伙伴可以參考下2015-04-04