Forums

[resolved] Lightbox 2 conflict with jCarousel (3 posts)

  1. Indent
    Member
    Posted 1 year ago #

    I'm experiencing the weirdest thing. I'm using WP 2.8.6 with the following plugins: Lightbox 2 v. 2.8.2 and jCarousel Lite v. 1.0.1 with jQuery 1.2.

    I'm using this on two different web-sites with a jCarousel slideshow on the frontpage. The problem is that jCarousel is only working on one of them. The problem seems to be that Lightbox on the frontpage loads all attached scripts and also writes in the head-tag:

    <!-- begin lightbox scripts -->
    	<script type="text/javascript">
        //<![CDATA[
        document.write('<link rel="stylesheet" href="http://localhost:8888/mysite/wp-content/plugins/lightbox-2/Themes/White/lightbox.css" type="text/css" media="screen" />');
        //]]>
        </script>
    	<!-- end lightbox scripts -->

    I don't get how the working site avoids that. I've tried to disable lightbox and install again, and I've also upgraded to the latest version. Nothing helps. Please somebody help. Thank you!

  2. Indent
    Member
    Posted 1 year ago #

    Nobody. Please?

  3. binary.digits
    Member
    Posted 1 year ago #

    The problem is that your other plugin may load another version of jQuery in which case the conflict will occur. To fix the issue you have to add
    jQuery.noConflict();
    before the
    $(document).ready(...) call.

    After this, you have to replace all $ signs with keword: jQuery in your script files.

    This worked for me!
    Sources:
    http://forums.obdev.at/viewtopic.php?f=6&t=2951

    http://groups.google.com/group/jquery-en/browse_thread/thread/2f47a1874e6423ae/b7ed8400d7034121?lnk=raot

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags