触摸启动和滑动不起作用
touchstart and swipe not working
Pretty simple Bootstrap website。我查看了如何在标准灯箱模态中启用滑动,发现其他人说对他们有用的代码,但它对我不起作用。
$('.carousel').bcSwipe({ threshold: 50 });
此外,我不知道如何向模式的关闭按钮添加触摸启动。我有一些 JS 经验,但对 jQuery 还是个新手。我也知道我的代码存在一些加载问题,这可能是罪魁祸首。
来吧。
这是我浏览器的开发控制台转储的内容:
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 库。
Pretty simple Bootstrap website。我查看了如何在标准灯箱模态中启用滑动,发现其他人说对他们有用的代码,但它对我不起作用。
$('.carousel').bcSwipe({ threshold: 50 });
此外,我不知道如何向模式的关闭按钮添加触摸启动。我有一些 JS 经验,但对 jQuery 还是个新手。我也知道我的代码存在一些加载问题,这可能是罪魁祸首。
来吧。
这是我浏览器的开发控制台转储的内容:
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 库。