不多说,直接上代码,其实就是让Facybox支持手指滑动。。。fancybox3已经支持了,不过他的样式太丑了。。这个的样式设计的有点象微信。。。有意思

$(document).ready(function() {

$('.js-fancybox').fancybox({
width: "100%",
margin: [0, 0, 0, 0],
padding: [0, 0, 0, 0],
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'fade',
nextEffect : 'fade',
closeBtn : false,
arrows: false,
helpers : {
title : null,
overlay : {
css : {
'background' : 'rgba(0, 0, 0, 0.95)'
}
},
buttons : {
}
},
afterShow: function() {
$('.fancybox-wrap').swipe({
swipe : function(event, direction) {
if (direction === 'left' || direction === 'up') {
$.fancybox.prev( direction );
} else {
$.fancybox.next( direction );
}
}
});
},
afterLoad : function() {
}
});

});
原文地址参考 :http://codepen.io/frontendstudio/pen/cixjm