2017-02-13 104 views
0

Pretty simple Bootstrap website。我查了一下如何在一个标准的灯箱模式中启用滑动,并找到别人说的为他们工作的代码,但它不适合我。touchstart和刷卡不工作

$('.carousel').bcSwipe({ threshold: 50 }); 

另外,我无法弄清楚如何将touchstart添加到关闭按钮的模式。我对JS有一些经验,但对jQuery来说很新。我也知道我的代码有一些加载问题可能是罪魁祸首。

有。

回答

0

这是我的浏览器的发展控制台甩什么:

jQuery.Deferred exception: $(...).bcSwipe is not a function TypeError: $(...).bcSwipe is not a function 
at HTMLDocument.<anonymous> (http://gregabyte.nfshost.com/js/script.js:47:18) 
at j (https://code.jquery.com/jquery-3.1.1.min.js:2:29948) 
at k (https://code.jquery.com/jquery-3.1.1.min.js:2:30262) undefined 

我接过来一看你的页面的源代码,我看不出既不jquery.bcSwipe.js,也不包括在它jquery.bcSwipe.min.js,所以我想你忘了包括bcSwipe库。

+0

啊。我不知道有一个库。我会包括这一点,看看会发生什么。 –