跪求,js手机移动端html点击图片弹出后可触摸屏左右滑动上下张图片的效果

JavaScript011

跪求,js手机移动端html点击图片弹出后可触摸屏左右滑动上下张图片的效果,第1张

这是一个叫photoswipe的插件,挺好用的,平滑滑动,上一张下一张,点击放大等功能

这是我自己精简了一下的.里面有Demo,你自己看吧.

可以使用事件绑定机制。

如:

$('元素').bind({

    'touchstart mousedown' : function(){

        $('#touch_tips').text('按下或触摸')

    },

    'touchmove mousemove' : function(){

       $('#touch_tips').text('移动中')

    },

    'touchend touchcancel mouseup' : function(){

       $('#touch_tips').text('松开')

    }

})

具体请搜索【touch event】手机触屏事件。注意,不支持windows phone!