Javascript 禁用移动设备上的引导传送带
我有一个多项目旋转木马,正是我想要的。然而,我不想在我的移动视图中有旋转木马。相反,我使用下面的代码,用户可以在手机中水平滚动:Javascript 禁用移动设备上的引导传送带,javascript,jquery,css,twitter-bootstrap,Javascript,Jquery,Css,Twitter Bootstrap,我有一个多项目旋转木马,正是我想要的。然而,我不想在我的移动视图中有旋转木马。相反,我使用下面的代码,用户可以在手机中水平滚动: @media (max-width: 991px) { .scroller { overflow-x: scroll; white-space: nowrap; } .scroller .col-sm-4 { display: inline-block; width: 70%;
@media (max-width: 991px) {
.scroller {
overflow-x: scroll;
white-space: nowrap;
}
.scroller .col-sm-4 {
display: inline-block;
width: 70%;
}
}
但它不起作用,因为在所有屏幕大小中都会调用引导转盘。您是否可以帮助carousel只在非移动设备中工作,然后在移动设备中被滚动条类替换
HTML:
Javascript:
$('.multi-item-carousel').carousel({
interval: false
});
// for every slide in carousel, copy the next slide's item in the slide.
// Do the same for the next, next item.
$('.multi-item-carousel .item').each(function(){
var next = $(this).next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
if (next.next().length>0) {
next.next().children(':first-child').clone().appendTo($(this));
} else {
$(this).siblings(':first').children(':first-child').clone().appendTo($(this));
}
});
.multi-item-carousel{
.carousel-inner{
> .item{
transition: 500ms ease-in-out left;
}
.active{
&.left{
left:-33%;
}
&.right{
left:33%;
}
}
.next{
left: 33%;
}
.prev{
left: -33%;
}
@media all and (transform-3d), (-webkit-transform-3d) {
> .item{
// use your favourite prefixer here
transition: 500ms ease-in-out left;
transition: 500ms ease-in-out all;
backface-visibility: visible;
transform: none!important;
}
}
}
.carouse-control{
&.left, &.right{
background-image: none;
}
}
}
$('.multi-item-carousel').carousel({
interval: false
});
// for every slide in carousel, copy the next slide's item in the slide.
// Do the same for the next, next item.
$('.multi-item-carousel .item').each(function(){
var next = $(this).next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
if (next.next().length>0) {
next.next().children(':first-child').clone().appendTo($(this));
} else {
$(this).siblings(':first').children(':first-child').clone().appendTo($(this));
}
});