WordPress.org

Support

Support » Themes and Templates » Highwind » Fancybox jQuery Conflict

Fancybox jQuery Conflict

  • I installed Fancybox (jQuery lightbox implementation) plugin on my site running the Highwind theme.

    The Fancybox would work, but theme’s scroll-to-top link would not appear anymore.

    Turns out this is a jQuery conflict.

    Fancybox is loading jQuery AFTER it has already been loaded by Highwind.

    The Highwind implementation of jQuery uses the noConflict function, which is then removed/overwritten when the Fancybox jQuery is loaded.

    My solution:

    1. Delete the script tag that loads jQuery for Fancybox. This means that Fancybox is now using the jQuery loaded by Highwind.
    2. In my javascript block that calls the Fancybox, replace “$” with “jQuery”. I made 2 replacements.

    Now the Fancybox works and the scroll-to-top appears and works.

    QUESTION FOR THEME AUTHOR:
    It appears that by using “noConflict” in your version of jQuery, any other plugin loading jQuery will break theme functions such as scroll-to-top.

    Have you implemented jQuery in the theme correctly?

Viewing 1 replies (of 1 total)
  • Theme Author James Koster

    @jameskoster

    Have you implemented jQuery in the theme correctly?

    Yes. Highwind loads WordPress’ native jQuery version via the dependency argument in wp_enqueue_script(). Are you sure the plugin is enqueing jQuery correctly?

Viewing 1 replies (of 1 total)
  • The topic ‘Fancybox jQuery Conflict’ is closed to new replies.
Skip to toolbar