Owl 轮播没有响应
Owl carousel not getting responsive
我实现了 Owl 轮播代码,它运行良好,但我坚持使用 owl 响应功能。它根本不起作用。
HTML代码为:
<div id="prd-slider" class="col-md-12" >
<!-- Item 1 Start -->
<div class="item">
<div class="Shop-Choice-sub-sec">
<div class="Shop-Choice-border"><a href=""> <img src="http://outsource.lightspeedwl.com/marketplace/media/catalog/category/new-img-3.png" style="padding: 10px; width: 59%; margin-left: 26px;"></a> </div>
<div class="Shop-Choice-text-section">
<div class="col-lg-12 Shop-Choice-name">Tshirts</div>
<div class="col-lg-12 Shop-Choice-star-img"> <img style="" src="http://outsource.lightspeedwl.com/marketplace/skin/frontend/default/emarketplace/images/star-img.png"> </div>
<span class="Shop-Choice-prise"></span> </div>
</div>
</div>
<!-- Item 1 end -->
<!-- Same structure for other items -->
</div>
css代码:
#prd-slider .item{
background: #fff;
padding: 5px 0px;
margin: 5px;
color: #FFF;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
text-align: center;
}
Java脚本代码为:
var owl = jQuery("#prd-slider");
owl.owlCarousel({
autoPlay :true,
slideSpeed : 300,
nav : false,
loop: true,
items : 5, //10 items above 1000px browser width
itemsDesktoplarg : [1000,2], //5 items between 1000px and 901px
itemsDesktop : [700,2],
itemsDesktopSmall : [660,2],// betweem 900px and 601px
itemsTablet: [650,1], //2 items between 600 and 0
itemsMobile : [400,1], // itemsMobile disabled - inherit from itemsTablet option
});
jQuery('.prev1').click(function(){
jQuery("#prd-slider").find('.owl-prev').click();
});
jQuery('.next1').click(function(){
jQuery("#prd-slider").find('.owl-next').click();
});
知道我哪里弄错了吗...?
我得到了解决方案,只有版本问题。我使用 2.0(新版本)但 owl 响应式无法正常工作。现在,当我用 1.3 替换时,它就可以工作了。
我实现了 Owl 轮播代码,它运行良好,但我坚持使用 owl 响应功能。它根本不起作用。
HTML代码为:
<div id="prd-slider" class="col-md-12" >
<!-- Item 1 Start -->
<div class="item">
<div class="Shop-Choice-sub-sec">
<div class="Shop-Choice-border"><a href=""> <img src="http://outsource.lightspeedwl.com/marketplace/media/catalog/category/new-img-3.png" style="padding: 10px; width: 59%; margin-left: 26px;"></a> </div>
<div class="Shop-Choice-text-section">
<div class="col-lg-12 Shop-Choice-name">Tshirts</div>
<div class="col-lg-12 Shop-Choice-star-img"> <img style="" src="http://outsource.lightspeedwl.com/marketplace/skin/frontend/default/emarketplace/images/star-img.png"> </div>
<span class="Shop-Choice-prise"></span> </div>
</div>
</div>
<!-- Item 1 end -->
<!-- Same structure for other items -->
</div>
css代码:
#prd-slider .item{
background: #fff;
padding: 5px 0px;
margin: 5px;
color: #FFF;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
text-align: center;
}
Java脚本代码为:
var owl = jQuery("#prd-slider");
owl.owlCarousel({
autoPlay :true,
slideSpeed : 300,
nav : false,
loop: true,
items : 5, //10 items above 1000px browser width
itemsDesktoplarg : [1000,2], //5 items between 1000px and 901px
itemsDesktop : [700,2],
itemsDesktopSmall : [660,2],// betweem 900px and 601px
itemsTablet: [650,1], //2 items between 600 and 0
itemsMobile : [400,1], // itemsMobile disabled - inherit from itemsTablet option
});
jQuery('.prev1').click(function(){
jQuery("#prd-slider").find('.owl-prev').click();
});
jQuery('.next1').click(function(){
jQuery("#prd-slider").find('.owl-next').click();
});
知道我哪里弄错了吗...?
我得到了解决方案,只有版本问题。我使用 2.0(新版本)但 owl 响应式无法正常工作。现在,当我用 1.3 替换时,它就可以工作了。