基于jquery插件制作左右按钮与标题文字图片切换效果
本例用了2个js文件jquery-ui-1.8.6.core.widget.js和jqueryui.bannerize.js,到演示页面可以查看
CSS Code
XML/HTML Code
JavaScript Code
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>
相关推荐
ITxiaobaibai 2020-07-04
alanlonglong 2020-06-14
PeterHuang0 2020-05-26
大地飞鸿 2020-01-06
飞翔的鱼 2019-11-16
yyHaker 2019-10-21
yangzzguang 2019-10-21
追逐阳光的风 2019-06-13
chenzhx 2019-09-06
我心飞翔之家 2019-04-01
咸鱼的星空 2018-09-25
那年夏天 2019-06-30
js网页特效 2019-06-28
zgwyfz 2018-09-25
hotbillow 2013-12-04
有心就有方向 2013-11-07
hexiankun 2016-02-03
kwenLee 2011-06-09