WordPress 页面上的 Galleriffic 和多个画廊

发布于 2024-11-17 12:34:15 字数 530 浏览 4 评论 0原文

我想我已经接近解决这个问题,并且需要一些帮助才能使其正常工作。我正在使用从 WordPress 帖子 ID 号动态生成的 ID 来创建独特的 Galleriffic 画廊。我的脚本似乎只获取一个唯一的选择器,而不是任何其他选择器。

您可以在此处查看该页面,

这是galleriffic初始化代码:

var galleryId = $('.gallery').attr('id');
var slideId = $('#'+galleryId+' > div');
var currentId = $('.thumbs_group').attr('id');
$('#'+galleryId).galleriffic('#'+currentId, {
    imageContainerSel: slideId
});

同样,此代码仅影响第一个画廊而不是第二个画廊。

任何想法将不胜感激。谢谢。

I think I'm close to figuring this out and would like some help to get this working properly. I am using dynamically generated IDs from Wordpress Post ID numbers to create unique Galleriffic galleries. My script seems to be grabbing only one unique selector and not any other.

You can see the page here

Here is the galleriffic init code:

var galleryId = $('.gallery').attr('id');
var slideId = $('#'+galleryId+' > div');
var currentId = $('.thumbs_group').attr('id');
$('#'+galleryId).galleriffic('#'+currentId, {
    imageContainerSel: slideId
});

Again, this code is only affecting the first gallery and not the second gallery.

Any ideas would be appreciated. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一人独醉 2024-11-24 12:34:15

您仅将该函数应用于一个 galleryID,请尝试

更新代码: 将上面的所有代码替换为:

$('.gallery').each(function(){
   $(this).galleriffic($(this).next(), {
       imageContainerSel: $(this).find('.slideshow')
   }
});

you are only applying the function to one galleryID, try

Updated code: replace all your code above with this:

$('.gallery').each(function(){
   $(this).galleriffic($(this).next(), {
       imageContainerSel: $(this).find('.slideshow')
   }
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文