PHP中字符串長度的截取用法示例
775
2024-01-10
本文實例為大家分享了jQuery進度條輪播的具體實現代碼,供大家參考,具體內容如下
HTML:
<div class="bannar"> <div class="img"> <ul> <li style="background:url(img/1.jpg);display:block;"></li> <li style="background:url(img/2.jpg);"></li> <li style="background:url(img/3.jpg);"></li> <li style="background:url(img/4.jpg);"></li> </ul> </div> <div class="text"> <ul> <li>0</li> <li>1</li> <li>2</li> <li>3</li> </ul> </div> <div class="nav"> <ul> <li><p></p></li> <li><p></p></li> <li><p></p></li> <li><p></p></li> </ul> </div> </div>
CSS:
<style> *{ margin:0 auto; padding:0; } .bannar{ width:100%; height:490px; position:relative; } .img{ width:100%; height:490px; overflow:hidden; } .img ul li{ width:100%; height:490px; list-style-type: none; display:none; } .text{ width:1000px; height:6px; position:absolute; bottom:28px; left:50%; margin-left:-500px; } .nav{ width:1000px; height:10px; position:absolute; bottom:4px; left:50%; margin-left:-500px; } .text ul li{ width:200px; height:100%; float:left; margin-left:38px; list-style-type: none; } .nav ul li{ width:200px; height:10px; float:left; margin-left:38px; list-style-type: none; background:gray; } .nav ul li p{ width:0px; height:100%; background:red; float:left; } </style>
Javascript:
<script> var i=0; var time_id=null; function auto(){ $(".nav ul li").eq(i).find("p").animate({ "width":"200px" },3900,function(){ i++; $(this).css("width", '0px'); if(i>3){ i=0; } $(".img ul li").eq(i).fadeIn(300).siblings().fadeOut(300); }); } time_id=setInterval("auto()",4000); $(".text ul li").click(function(){ $(".nav ul li").find("p").stop().css("width","0px"); clearInterval(time_id); i=$(this).index(); $(".img ul li").eq(i).fadeIn().siblings().fadeOut(); auto(); time_id=setInterval("auto()",4000); }); $(".nav ul li").click(function(){ $(".nav ul li").find("p").stop().css("width","0px"); clearInterval(time_id); i=$(this).index(); $(".img ul li").eq(i).fadeIn().siblings().fadeOut(); auto(); time_id=setInterval("auto()",4000); }) </script>
效果圖:
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持綠夏網。
#免責聲明#
本站[綠夏技術導航]提供的一切軟件、教程和內容信息僅限用于學習和研究目的;不得將上述內容用于商業或者非法用途,否則,一切后果請用戶自負。本站信息來自網絡收集整理,版權爭議與本站無關。您必須在下載后的24個小時之內,從您的電腦或手機中徹底刪除上述內容。如果您喜歡該程序或內容,請支持正版,購買注冊,得到更好的正版服務。我們非常重視版權問題,如有侵權請郵件[admin@lxwl520.com]與我們聯系進行刪除處理。敬請諒解!