Support » Plugin: Simple Lightbox » Clash with jQuery

  • Resolved johnevanofski


    Hi there,

    I’m having an issue where the jQuery Easing plugin appears to be clashing with this plugin and subsequently disabling jQuery on my page.

    The error comes in at line 46 on the jQuery Easing v1.3; this issue resolves when I disable the lightbox plugin.

    “Uncaught TypeError:Property ‘undefined’ of object #<Object> is not a function

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Here’s the page effected:

    Plugin Author Archetyped


    Hi, I’m not seeing the same error you’re referring to, but it does look like jQuery is being loaded twice for the page. The first time appears to be hardcoded in the theme’s markup, while the other is loaded by WordPress itself.

    Themes and plugins should always load scripts and styles via WP’s file loading API (e.g. using wp_enqueue_script()). WP will automatically stop scripts from being loaded multiple times when scripts are loaded in this way, which can alleviate many issues.

    Let me know if you’re still experiencing the same issue once you get the theme’s scripts loaded using wp_enqueue_script() and I’d be glad to take another look.

    That seems to have resolved the issue, I used:

        function my_scripts_method() {
                get_template_directory_uri() . '/js/jquery.easing.1.3.js',
        add_action('wp_enqueue_scripts', 'my_scripts_method');

    Also note to anyone with the problem in the future you will need to take your $(…) method out in leu of jQuery(…)

    Plugin Author Archetyped


    Glad your issue was resolved.

    Also, the use of $() as an alias for jQuery() should not be affected. Did you mean something else?

    No, it appears that I have to use the jQuery() alias otherwise the code doesn’t work.

    It even says something about it in the wp_enqueue_script() doc

    Plugin Author Archetyped


    As long as you wrap the code in an immediately executing anonymous function (as described in the link you posted), $() can be freely used as an alias for jQuery() throughout your code without issue.

    Any publicly distributed library that uses jQuery should be expected to do this as well to avoid conflicts with other code.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Clash with jQuery’ is closed to new replies.