将灯箱与Jssor图库同步

时间:2018-11-26 12:08:10

标签: gallery lightbox jssor synchronize

我有一个Jssor画廊,可以在选项中进行自动播放。当我将鼠标放在图库中时,自动播放停止。那就对了。 我还有一个灯箱,可以查看真实尺寸的图像,但是当我打开灯箱时,后图库中的图像会发生变化。我希望在打开灯箱时,背景画廊也暂停。甚至在将图片传递到灯箱中时更改项目。 这有没有可能? 谢谢。

1 个答案:

答案 0 :(得分:0)

谢谢Jssor。

//Pause the gallery when we access the Lightbox
$('#gallery_img1').click(function(){
  jssor_1_slider.$Pause();
});
//Go to the next image in the gallery when you pass in Lightbox
$('#next-button').on('click', function(){
  if (jssor_1_slider.$CurrentIndex() < (jssor_1_slider.$SlidesCount()-1)){
    jssor_1_slider.$Next();
  }
});   
//Go to the previous image in the gallery when passing in Lightbox
$('#previous-button').on('click', function(){
  if (jssor_1_slider.$CurrentIndex() > 0){
    jssor_1_slider.$Prev();
  }
});   
相关问题