简体   繁体   English

带有灯箱的无限Ajax滚动

[英]Infinite ajax scroll with lightbox

Hi guys I'm using infiniteajaxscroll to load my photos on scroll down, the problem is the lightbox I'm using wont work on loaded pages. 嗨,大家好,我正在使用infiniteajaxscroll向下滚动加载照片,问题是我正在使用的灯箱无法在加载的页面上正常工作。

My ininiteajaxscroll jquery 我的ininiteajaxscroll jQuery

var ias = $.ias({
  container :'.wrap', // main container where data goes to append
  item:'.box-foto', // single items
  pagination:'.paginacao', // page navigation
  next:'.paginacao a', // next page selector
  text: 'LOAD MORE PHOTOS'
});


ias.extension(new IASSpinnerExtension( ));
ias.extension(new IASTriggerExtension({offset: 10}));

This is my lightbox code: http://sachinchoolur.github.io/lightGallery/ 这是我的灯箱代码: http : //sachinchoolur.github.io/lightGallery/

function zoomPhotos(){

  $("#list-photos-int").lightGallery({
    thumbnail:true,
    selector: '.box-thumb'
  });
}

How can I use both components together on loaded pages? 如何在加载的页面上同时使用这两个组件?

Thanks. 谢谢。

You need to load lightgallery in a callback like this: 您需要像这样在回调中加载lightgallery:

ias.on('rendered', function(items) {
$("#list-photos-int").lightGallery({
thumbnail:true,
selector: '.box-thumb'
});
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM