【发布时间】:2016-07-29 21:59:38
【问题描述】:
我使用 featherlight.gallery.js 制作了一个画廊,并按照说明 (https://github.com/noelboss/featherlight/#featherlight-gallery) 通过加载 jquery detect_swipe.js 来支持滑动/触摸。
问题是我想同时进行滑动/触摸和鼠标单击导航,并且由于某种原因它以一种或另一种方式进行。如果我使用的是平板电脑,即使可以滑动,我也不一定想滑动,因为我可能正在使用鼠标进行导航。
我用 detect_swipe.js 文件创建了一个小提琴,它可以使用触摸而不是鼠标:
http://jsfiddle.net/scotsscripts/JNsu6/213/
这是未启用触摸的示例羽毛灯画廊小提琴(羽毛灯“官方示例”的副本):
HTML 是超级基础的,唯一改变的是是否加载了detect_Swipe.js:
<h3>Gallery</h3>
<div data-featherlight-gallery data-featherlight-filter="a">
<a href="http://farm8.staticflickr.com/7070/6874560581_dc2b407cc0_b.jpg"><img src="http://farm8.staticflickr.com/7070/6874560581_dc2b407cc0_q.jpg" /></a>
<a href="http://farm5.staticflickr.com/4005/4400559493_3403152632_o.jpg"><img src="http://farm5.staticflickr.com/4005/4400559493_f652202d1b_q.jpg" /></a>
<a href="http://farm1.staticflickr.com/174/396673914_be9d1312b1_o.jpg"><img src="http://farm1.staticflickr.com/174/396673914_be9d1312b1_q.jpg" /></a>
</div>
你知道为什么鼠标和触摸不能一起工作吗?有什么简单的修复方法吗?提前致谢。
【问题讨论】: