作者:Happy的紫璐 | 来源:互联网 | 2023-06-06 20:10
Hy,Imhavingsomeproblemsmakinglightbox(inmycaseslimbox2)workafternewcontentisloaded
Hy, I'm having some problems making lightbox (in my case slimbox 2) work after new content is loaded. I understand that slimbox needs to be called again, but I tried almost everything. Here is the code how new content is been loaded:
Hy,我在加载新内容后制作灯箱(在我的情况下是slimbox 2)时遇到了一些问题。我知道苗条盒需要再次调用,但我几乎尝试了所有东西。以下是加载新内容的代码:
...var link = $('Load more');
link.click(loadMore);...
loadMore is the function that loads new content. this is just a piece of code. if you need the whole code let me know.
loadMore是加载新内容的函数。这只是一段代码。如果您需要整个代码,请告诉我。
Here is the slimbox code.
这是slimbox代码。
jQuery(function($) {
$("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
the new content has the rel attributes but it wont work. can i combine the click function from above to call slimbox code again.
新内容具有rel属性但它不起作用。我可以结合上面的点击功能再次调用slimbox代码。
1 个解决方案