今天咱們介紹一款使用簡單,支持自定義樣式而且靈活健壯的jQuery旋轉輪播插件:CarouFredSel ,可以幫助你迅速的構建一個輪播式的幻燈展現,使用簡單,功能強大,但願你們喜歡!jquery
如下是基本使用代碼範例,若是你們有興趣,能夠參考CarouFredSel網站上的其它例子flex
HTML代碼:網站
<div class="image_carousel"> <div id="foo1"> <img src="/examples/images/small/basketball.jpg" alt="basketball" width="140" height="140" /> <img src="/examples/images/small/beachtree.jpg" alt="beachtree" width="140" height="140" /> <img src="/examples/images/small/cupcackes.jpg" alt="cupcackes" width="140" height="140" /> <img src="/examples/images/small/hangmat.jpg" alt="hangmat" width="140" height="140" /> <img src="/examples/images/small/new_york.jpg" alt="new york" width="140" height="140" /> <img src="/examples/images/small/laundry.jpg" alt="laundry" width="140" height="140" /> <img src="/examples/images/small/mom_son.jpg" alt="mom son" width="140" height="140" /> <img src="/examples/images/small/picknick.jpg" alt="picknick" width="140" height="140" /> <img src="/examples/images/small/shoes.jpg" alt="shoes" width="140" height="140" /> <img src="/examples/images/small/paris.jpg" alt="paris" width="140" height="140" /> <img src="/examples/images/small/sunbading.jpg" alt="sunbading" width="140" height="140" /> <img src="/examples/images/small/yellow_couple.jpg" alt="yellow couple" width="140" height="140" /> </div> <div class="clearfix"></div> </div>
CSS樣式:ui
.image_carousel { padding: 15px 0 15px 40px; } .image_carousel img { border: 1px solid #ccc; background-color: white; padding: 9px; margin: 7px; display: block; float: left; } .clearfix { float: none; clear: both; }
Javascript代碼:spa
$("#foo1").carouFredSel();