WordPress.org

Support

Support » Plugins and Hacks » Flickr Gallery » [Plugin: Flickr Gallery] jQuery Error: flightbox not a function

[Plugin: Flickr Gallery] jQuery Error: flightbox not a function

Viewing 7 replies - 1 through 7 (of 7 total)
  • I was having the same problem. I believe that the answer and the solution are to be found here:

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers

    Looking at the code in the plugin file jquery.lightbox.js it seems that it is not using ‘no-conflict’ mode. I wrapped the JavaScript as described at the link above. Now the error is gone and the lightbox works.

    I hate to sound like an idiot kwilliarty but would you be willing to give the dumbed down version of which code needs to be changed and what to change it to? I tried a few different things in that .js file but I still get the javascript error and it prevents other scripts on my page from working.

    Fixed my own issue. Realized you were talking about the code in flickr-gallery.php and not the .js file. For those who see this (and maybe the developer) you need to do the following:

    In the file flickr-gallery.php Go to line 1431. You should see the following code:

    <script type="text/javascript">
    				(function($){
    					$(function(){
    						$("img.flickr.square,img.flickr.thumbnail,img.flickr.small").flightbox({size_callback: get_sizes});
    					});
    				})(jQuery);
    			</script>

    The developer meant to put it in no conflict mode at the beginning there but there’s an extra $function line that is not necessary. Here is the proper code you can replace that section with that will not throw an error:

    <script type="text/javascript">
    				(function($){
    						$("img.flickr.square,img.flickr.thumbnail,img.flickr.small").flightbox({size_callback: get_sizes});
    					});(jQuery);
    			</script>

    Hi timmmmyboy,

    I was in fact talking about the jquery.lightbox.js. I wrapped the JavaScript in that file with these lines:

    jQuery(document).ready(function($) {
    ...
    });

    That change worked for me.

    I wonder if we are somehow looking at different versions of the code. (I have 1.5.2). I find the code you mention in flickr-gallery.php around line 1074. I don’t have a line 1431. If I unmake my own change and apply the change you describe the lightbox stops working for me.

    hi keiliarty, how to put that code? i have the same problem

    You have to edit the file in the plugin folder. The path to the file withing the plugin folder is:

    /flightbox/jquery.flightbox.js

    The very beginning of the script that works for me (starting right after the commented head-matter) looks like this:

    jQuery(document).ready(function($) {
    ;(function($){
        $.flightboxIsVideo = false;

    where the very first line is the one that I added. The very bottom of my file looks like this:

    }
    })(jQuery);
    });

    where the very last line is the one that I added. Other solutions maybe be possible or better. At least for me, this does the trick.

    I think I found an even better solution, find a plugin which works!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Flickr Gallery] jQuery Error: flightbox not a function’ is closed to new replies.
Skip to toolbar