fancybox手动调用添加以前的值

发布于 2025-01-03 15:30:06 字数 1366 浏览 8 评论 0原文

我几天前刚刚询问过fancybox手动调用特定目标

现在我还有一个问题。我喜欢实现多个 fancybox 画廊。第一个画廊效果很好。但是,当我包含第二个画廊(例如代码:)时,

    $("#manual1").click(function() {
        $.fancybox([
            'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
            'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
            {
                'href'  : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
                'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
            }
        ], {...
        });
    });
$("#manual2").click(function() {
        $.fancybox([
            'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
            'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
            {
                'href'  : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
                'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
            }
        ], {...
        });
    });

第二个画廊包含第一个画廊的图片。因此,在这个例子中,我将有一个包含 3 张图片的第一个画廊 (#manual1) 和一个包含 6 张图片的第二个画廊 (#manual2)。但我喜欢第二张中只有 3 张照片。 (第三个更糟糕)。

我该如何解决这个问题? $.fancybox().removeData(); 的效果不如 $('something_in_here').fancybox( 没有帮助。

I just asked several days ago about fancybox manual call to a specific target

now I have a further problem. I like to implement more than one fancybox gallery. The first gallery works well. But when I include a second one (e.g. code:)

    $("#manual1").click(function() {
        $.fancybox([
            'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
            'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
            {
                'href'  : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
                'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
            }
        ], {...
        });
    });
$("#manual2").click(function() {
        $.fancybox([
            'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
            'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
            {
                'href'  : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
                'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
            }
        ], {...
        });
    });

the second gallery includes the pictures from the first. So in this example I will have a first gallery (#manual1) with 3 pictures and a second gallery (#manual2) with 6 pictures. But I like to have only 3 pics in the second one. (And a third one is even worse).

How can I solve this problem? $.fancybox().removeData(); doesn't work as well as $('something_in_here').fancybox( does not help.

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

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

发布评论

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

评论(2

不疑不惑不回忆 2025-01-10 15:30:06

如果您复制相同的代码并仅更改选择器,当然您将获得相同的信息。

您可以在此处定义每个画廊的图片,

$.fancybox([
            'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
            'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
            {
                'href'  : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
                'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
            }
        ],

因此请相应地更改每个画廊的路径

http://newSite.com/newPath/newImage.jpg

If you copy the same code and only change the selector, of course you will have the same information.

Here is where you define what pictures for each gallery

$.fancybox([
            'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
            'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
            {
                'href'  : 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
                'title' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
            }
        ],

so change the path accordingly for each gallery

http://newSite.com/newPath/newImage.jpg
油焖大侠 2025-01-10 15:30:06

只是在这里猜测,但范围没有定义......如果你尝试像 $(this).fancybox([

Just guessing here, but the scope isn't defined...what if you tried something like $(this).fancybox([

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文