码迷,mamicode.com
首页 > 其他好文 > 详细

owl-carousel轮播插件的使用

时间:2015-08-11 15:33:46      阅读:415      评论:0      收藏:0      [点我收藏+]

标签:

插件github地址:https://github.com/OwlFonk/OwlCarousel;

插件官网演示地址:http://owlgraphic.com/owlcarousel/;

 

 

1.选择你所需要的轮播插件类型

技术分享

 

2.根据每个类型的文档,赋值html的DOM结构

比如images

<div id="owl-demo">
          
  <div class="item"><img src="assets/owl1.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl2.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl3.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl4.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl5.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl6.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl7.jpg" alt="Owl Image"></div>
  <div class="item"><img src="assets/owl8.jpg" alt="Owl Image"></div>
 
</div>

  

3.在js中调用

以images为例:

$(document).ready(function() {
 
  $("#owl-demo").owlCarousel({
 
      autoPlay: 3000, //Set AutoPlay to 3 seconds
 
      items : 4,
      itemsDesktop : [1199,3],
      itemsDesktopSmall : [979,3]
 
  });
 
});

  

成功!

技术分享

 

owl-carousel轮播插件的使用

标签:

原文地址:http://www.cnblogs.com/yzg1/p/4720781.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!