超漂亮的jQuery图片轮播特效
网络编程 2021-07-04 21:03www.168986.cn编程入门
这篇文章为大家分享了超漂亮的jQuery图片轮播特效,支持Ajax加载数据,响应式布局,支持移动端触屏,功能强大,感兴趣的小伙伴们可以参考一下
超漂亮的jQuery图片轮播特效,使用了插件jCarousel,很棒的jQuery插件,支持带缩略图左右切换,支持Ajax加载数据,响应式布局,支持移动端触屏,强大的API参数配置功能以及函数回调功能,支持自定义动画速度和动画模式,支持轮播方向定义,还是很不错的,推荐学习和使用。
使用方法
1.加载jQuery和插件
<link rel="stylesheet" type="text/css" href="jcarousel.basic.css"> <script type="text/javascript" src="libs/jquery/jquery.js"></script> <script type="text/javascript" src="dist/jquery.jcarousel.min.js"></script>
2.HTML内容
<div class="jcarousel-wrapper"> <div class="jcarousel"> <ul> <li><img src="../_shared/img/img1.jpg" width="600" height="400" alt=""></li> <li><img src="../_shared/img/img2.jpg" width="600" height="400" alt=""></li> <li><img src="../_shared/img/img3.jpg" width="600" height="400" alt=""></li> <li><img src="../_shared/img/img4.jpg" width="600" height="400" alt=""></li> <li><img src="../_shared/img/img5.jpg" width="600" height="400" alt=""></li> <li><img src="../_shared/img/img6.jpg" width="600" height="400" alt=""></li> </ul> </div> <a href="#" class="jcarousel-control-prev">‹</a> <a href="#" class="jcarousel-control-next">›</a> <p class="jcarousel-pagination"> </p> </div>
3.函数调用
<script type="text/javascript"> $(function(){ $('.jcarousel').jcarousel(); $('.jcarousel-control-prev') .on('jcarouselcontrol:active', function() { $(this).removeClass('inactive'); }) .on('jcarouselcontrol:inactive', function() { $(this).addClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('.jcarousel-control-next') .on('jcarouselcontrol:active', function() { $(this).removeClass('inactive'); }) .on('jcarouselcontrol:inactive', function() { $(this).addClass('inactive'); }) .jcarouselControl({ target: '+=1' }); $('.jcarousel-pagination') .on('jcarouselpagination:active', 'a', function() { $(this).addClass('active'); }) .on('jcarouselpagination:inactive', 'a', function() { $(this).removeClass('active'); }) .jcarouselPagination(); }); });
以上就是为大家推荐的jQuery图片轮播特效的关键代码,大家还需要进一步的完善,可以结合之前的文章进行学习,一定会有意想不到的收获。
上一篇:JS截取字符串实例详解
下一篇:jquery实现移动端点击图片查看大图特效
编程语言
- 宿迁百度关键词排名指南:实现精准营销的关键
- 四川SEO优化怎么做网络推广
- 立昂技术备案老域名收购:如何为您的业务赋能
- 安徽百度关键词seo贵不贵,一般需要多少钱
- 吉林百度快照排名怎么做电话营销
- 多伦新手做SEO怎么做
- 甘肃优化关键词排名推广怎么做论坛营销
- 沙雅SEO网站推广:提升您的在线可见性
- 四川SEO优化如何提升销售额和销售量
- 聂荣网站排名优化:提升网站可见性的全方位指
- 涞水SEO:提升地方企业在线可见性的策略
- 辽宁百度seo排名怎样做网站排名
- 临湘哪有关键词排名优化:提升网站可见度的关
- 黑龙江百度网站优化有没有优惠
- 凉城优化关键词排名推广:提升您的网络可见性
- 萝北整站优化:提升您网站流量和排名的全面指