我使用zepto的longtap事件 长按某个图片750ms毫秒后触发某个事件
但是触发事件后,弹出了保存图片。这该怎么办?
巴扎黑2017-04-10 15:12:30
可以试试这样来解决
css
p.img{ position:relative; } p.img:before{ position:absolute; top:0; right:0; bottom:0; left:0; z-index:2; content:"\20"; width:100%; height:100%; display:block; background-color:rgba(255,255,255,0); } p.img>img{ max-width:100%; display:block; }
html
<p class="img"><img src="//static.segmentfault.com/build/global/img/logo-w.svg"></p>
也可以在longTap里判断 event.target.nodeName == 'IMG'