ani*_*kcx 1 javascript jquery swipe carousel twitter-bootstrap-3
我使用TouchSwipe插件进行旋转木马滑动效果.
问题是当我将图像或内容封闭在内时,滑动不起作用
<a href=""></a>
Run Code Online (Sandbox Code Playgroud)
我尝试将它们分配给z-index,但它仍然不起作用.
我甚至尝试了他们的例子并使用inspect元素尝试了同样的事情.
http://lazcreative.com/bs3/touchswipe.html
这是剧本: -
$('#carousel-example-generic-myslider').swipe( {
swipeLeft: function() {
$(this).carousel('next');
},
swipeRight: function() {
$(this).carousel('prev');
},
allowPageScroll: 'vertical'
});
Run Code Online (Sandbox Code Playgroud)
请帮忙.
谢谢
对于touchswipe,有一个默认为"excludedElements"的选项"button, input, select, textarea, a, .noSwipe".因此,'a'标签将从滑动事件中排除.您需要从中删除该'a'引用.
尝试此初始化,例如:
$('#carousel-example-generic-myslider').swipe( {
swipeLeft: function() {
$(this).carousel('next');
},
swipeRight: function() {
$(this).carousel('prev');
},
allowPageScroll: 'vertical',
excludedElements: "button, input, select, textarea, .noSwipe"
});
Run Code Online (Sandbox Code Playgroud)