本例用了2个js文件jquery-ui-1.8.6.core.widget.js和jqueryui.bannerize.js,到演示页面可以查看
CSS Code
- <style type="text/css">
- *{margin:0;padding:0;list-style-type:none;}
- a,img{border:0;}
- /* ui-banner */
- .ui-banner{display:block;position:relative;width:820px;margin:20px auto;}
- .ui-banner.ui-banner-invalid{display:none;}
- .ui-banner,.ui-banner .ui-banner-slides,.ui-banner .ui-banner-slogans,.ui-banner .ui-banner-arrow{height:233px;}
- .ui-banner .ui-banner-slides,.ui-banner .ui-banner-slogans,.ui-banner .ui-banner-arrow{position:absolute;top:0;}
- .ui-banner ul{list-style-type:none;margin:0;padding:0;overflow:hidden;}
- .ui-banner .ui-banner-slides{width:654px;height:233px;left:1px;}
- .ui-banner .ui-banner-slides li{display:none;position:absolute;}
- .ui-banner .ui-banner-slides li img{width:654px;height:233px;border:none;}
- .ui-banner .ui-banner-slides li.ui-banner-slides-current,.ui-banner .ui-banner-slides li.ui-banner-slides-prev,.ui-banner .ui-banner-slides li.ui-banner-slides-next{display:block;}
- .ui-banner .ui-banner-slides li.ui-banner-slides-current{left:0;}
- .ui-banner .ui-banner-slides li.ui-banner-slides-prev{left:-654px;}
- .ui-banner .ui-banner-slides li.ui-banner-slides-next{left:654px;}
- .ui-banner .ui-banner-slogans{background:#009AC9;height:213px;overflow:hidden;padding:10px 30px 10px 15px;width:118px;rightright:0;}
- .ui-banner .ui-banner-slogans li{cursor:pointer;color:#8DC4EC;text-align:left;font-weight:bold;font-size:12px;line-height:14px;padding:10px 0 10px 10px;margin-left:5px;border-bottom:1px solid #79B4DF;list-style:none;list-style-type:none;}
- .ui-banner .ui-banner-slogans li.ui-banner-slogans-current{color:#FFF;}
- .ui-banner .ui-banner-slogans li.ui-banner-slogans-prev{border-bottom:none;}
- .ui-banner .ui-banner-arrow{display:block;width:45px;outline:none;}
- .ui-banner .ui-banner-arrow.ui-banner-arrow-prev{left:-14px;top:100px;background:transparent url("images/hero-slider-arrow-left.png") no-repeat 0 0;}
- .ui-banner .ui-banner-arrow.ui-banner-arrow-next{left:630px;top:100px;background:transparent url("images/hero-slider-arrow-right.png") no-repeat 0 0;}
- .ui-banner .ui-banner-arrow.ui-banner-arrow-next img{left:-15px;}
- .ui-banner .ui-banner-overlay{bottombottom:0;height:10px;position:absolute;rightright:0;width:173px;}
- </style>
XML/HTML Code
- <div id="banners" class="ui-banner">
- <ul class="ui-banner-slides">
- <li><a href=""><img src="../dalian.jpg" alt="" title=""></a></li>
- <li><a href=""><img src="../erlianhaote.png" alt="" title=""></a></li>
- <li><a href=""><img src="../mohe.png" alt="" title=""></a></li>
- <li><a href=""><img src="../sanya.jpg" alt="" title=""></a></li>
- <li><a href=""><img src="../xianggang.jpg" alt="" title=""></a></li>
- <li><a href=""><img src="../zhoushan.jpg" alt="" title=""></a></li>
- </ul><!--ui-banner-slides end-->
- <ul class="ui-banner-slogans">
- <li>大连</li>
- <li>二连浩特</li>
- <li>漠河</li>
- <li>三亚</li>
- <li>香港</li>
- <li>舟山</li>
- </ul><!--ui-banner-slogans end-->
- <a href="" class="ui-banner-arrow ui-banner-arrow-prev png_bg"></a><a href="" class="ui-banner-arrow ui-banner-arrow-next png_bg"></a><div class="ui-banner-overlay png_bg"></div></div>
JavaScript Code
- <script type="text/javascript">
- $(document).ready(function(){
- $('#banners').bannerize({
- shuffle: 1,
- interval: "5"
- });
- });
- </script>
原文地址:http://www.freejs.net/article_jiaodiantu_80.html