将 Flickr 与 Codrops FullScreen Gallery 集成问题

发布于 2024-12-02 23:48:40 字数 1958 浏览 3 评论 0原文

我目前正在使用 Codrops 全屏图库来构建 Flickr 图库。我已经设法从 flickr 帐户导入 flickr 图像,并且我已经获得了与非 flickr 图像一起使用的全屏图像,但是当告诉 flickr 使用 Codrops 画廊时,它似乎停止工作。

网站网址:http://www.media21a.co.uk/development/fullthrottle/flickr / 这是 Flickr 文档: http:// /www.media21a.co.uk/development/fullthrottle/wp-content/themes/fullthrottle/js/flickrImport.js 这是图库文档: http:// /www.media21a.co.uk/development/fullthrottle/wp-content/themes/fullthrottle/js/gallery.js

我知道如何让它与 fancybox (lightbox) 一起使用,但是我不知道如何让它与 codrops 画廊一起工作。

function attachFancyBox()
{
    $(".fancyBox").fancybox();
} 

    /*  BEGIN OPTIONAL FANCYBOX PARAMS */
    "rel":"casabelmonte",            // Rel tag to enable forward/back buttons on fancybox
    "imageLink":"preview",         // Tells the script to grab the image url for fancybox to show
    "className":"fancyBox",     // Class for attaching fancybox
    "callback":attachFancyBox  // Once the images show attach the fancybox script
    /* END */

如果需要,这里是我的全局脚本:

$(window).load(function() {


    $(".dropgallery a, #fp_thumbtoggle").removeAttr("title");

    $('#fp_thumbtoggle, .dropgallery img').click(function() {
        $('#fp_thumbtoggle').toggleClass("active");

        if ($('#fp_thumbtoggle').hasClass('active')){
            $('#fp_thumbtoggle').animate({top:'65px'});
        }else{
            $('#fp_thumbtoggle').animate({top:'185px'});
        }
        $('.dropgallery').slideToggle('500');

    });

    });

我已经设法获取 Youtube & Vimeo 视频已导入,效果非常好,如果您能帮我解决这个问题,我一定会在网站的编码中添加您的链接,并且我会在 facebook 和 facebook 上添加一些留言。推特:)。

I'm currently putting together a Flickr gallery with the use of the Codrops full-screen gallery. I've managed to import the flickr images from a flickr account and I've got the full-screen images working with non-flickr images but when telling the flickr to work with the Codrops gallery its seems to stop working.

Website URL: http://www.media21a.co.uk/development/fullthrottle/flickr/
This is the Flickr document: http://www.media21a.co.uk/development/fullthrottle/wp-content/themes/fullthrottle/js/flickrImport.js
This is the Gallery document: http://www.media21a.co.uk/development/fullthrottle/wp-content/themes/fullthrottle/js/gallery.js

I know how to get it working with fancybox (lightbox) but i'm not sure how to get it workig with the codrops gallery.

function attachFancyBox()
{
    $(".fancyBox").fancybox();
} 

    /*  BEGIN OPTIONAL FANCYBOX PARAMS */
    "rel":"casabelmonte",            // Rel tag to enable forward/back buttons on fancybox
    "imageLink":"preview",         // Tells the script to grab the image url for fancybox to show
    "className":"fancyBox",     // Class for attaching fancybox
    "callback":attachFancyBox  // Once the images show attach the fancybox script
    /* END */

If needed here is my Global script:

$(window).load(function() {


    $(".dropgallery a, #fp_thumbtoggle").removeAttr("title");

    $('#fp_thumbtoggle, .dropgallery img').click(function() {
        $('#fp_thumbtoggle').toggleClass("active");

        if ($('#fp_thumbtoggle').hasClass('active')){
            $('#fp_thumbtoggle').animate({top:'65px'});
        }else{
            $('#fp_thumbtoggle').animate({top:'185px'});
        }
        $('.dropgallery').slideToggle('500');

    });

    });

I've managed to get Youtube & Vimeo videos imported and it works great, if you could help me out on this i'll sure add your link within the coding on the website and i'll add a couple shout outs on facebook & twitter : ).

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

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

发布评论

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

评论(1

吾性傲以野 2024-12-09 23:48:40

您尝试为尚不存在的元素绑定单击处理程序(用于拇指),因为它们是动态加载的。要使其工作,请将行(在 gallery.js 中)替换

$thumbScroller.find('.content').bind('click', function(e){

为:

$thumbScroller.find('.content').live('click', function(e){

这将使缩略图单击工作。之后,在 flickrImport.js 中将图像 alt 属性中的 url 从 _m 更改为 _b 大小,以便在单击后加载图像的大版本,而不是再次加载 _m 大小。示例:

alt="http://farm'+photo.farm+'.static.flickr.com/'+photo.server+'/'+photo.id+'_'+photo.secret+'_m.jpg"

更改为:

alt="http://farm'+photo.farm+'.static.flickr.com/'+photo.server+'/'+photo.id+'_'+photo.secret+'_b.jpg"

编辑:我忘了提及 - 缺少两个函数(showNav() 和 hideThumbs())。它们是从 gallery.js 内部调用的。

You try to bind click handler (for thumbs) for elements that don't exists yet, since they're dynamically loaded. To make it work, replace line (in gallery.js):

$thumbScroller.find('.content').bind('click', function(e){

to:

$thumbScroller.find('.content').live('click', function(e){

That will make thumbnail clicking work. After that, in flickrImport.js change the url that is fitted in the alt attribute of image from _m to _b size, so that after you click the big version of the image is loaded, not the _m size again. Example:

alt="http://farm'+photo.farm+'.static.flickr.com/'+photo.server+'/'+photo.id+'_'+photo.secret+'_m.jpg"

change to:

alt="http://farm'+photo.farm+'.static.flickr.com/'+photo.server+'/'+photo.id+'_'+photo.secret+'_b.jpg"

EDIT: I forgot to mention - there were two functions missing (showNav() and hideThumbs()). They are called from within of gallery.js.

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