标签: javascript photoswipe
当图库发生变化时,会有一个特定的photoswipe事件会收听。
// After slides change // (after content changed) pswp.listen('afterChange', function() { });
我想知道是否有办法从左或右检测变化的方向。有没有人有想法?
http://photoswipe.com/documentation/api.html
答案 0 :(得分:0)
您可以比较此事件处理程序中的索引,pswp.getCurrentIndex()将返回当前幻灯片索引。
pswp.getCurrentIndex()