html图片淡入淡出轮播图,jquery全屏响应式淡入淡出效果轮播图插件

这是一款jquery全屏响应式淡入淡出效果轮播图插件。该轮播图插件简单实用,兼容ie8浏览器,可以自动切换播放,带淡入淡出的动画效果。

使用方法

在页面中引入jquery和jquery.flexslider-min.js文件。

HTML结构

实用一个

作为轮播图的容器,然后在里面放置一个无序列表。轮播图中的图片以背景图片的方式在每一个列表项中设置。

CSS样式

为轮播图添加下面的CSS样式:

*{margin:0;padding:0;list-style-type:none;}

a,img{border:0;}

/* flexslider */

.flexslider{position:relative;height:400px;overflow:hidden;background:url(images/loading.gif) 50% no-repeat;}

.slides{position:relative;z-index:1;}

.slides li{height:400px;}

.flex-control-nav{position:absolute;bottom:10px;z-index:2;width:100%;text-align:center;}

.flex-control-nav li{display:inline-block;width:14px;height:14px;margin:0 5px;*display:inline;zoom:1;}

.flex-control-nav a{display:inline-block;width:14px;height:14px;line-height:40px;overflow:hidden;

background:url(images/dot.png) right 0 no-repeat;cursor:pointer;}

.flex-control-nav .flex-active{background-position:0 0;}

.flex-direction-nav{position:absolute;z-index:3;width:100%;top:45%;}

.flex-direction-nav li a{display:block;width:50px;height:50px;overflow:hidden;cursor:pointer;position:absolute;}

.flex-direction-nav li a.flex-prev{left:40px;background:url(images/prev.png) center center no-repeat;}

.flex-direction-nav li a.flex-next{right:40px;background:url(images/next.png) center center no-repeat;}

初始化插件

在页面DOM元素加载完毕之后,可以通过flexslider()方法来初始化该轮播图。

$(document).ready(function(){

$('.flexslider').flexslider({

directionNav: true,

pauseOnAction: false

});

});

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值