Results 1 to 5 of 5

Thread: Lightbox conflict with another jquery files.

  1. #1
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Lightbox conflict with another jquery files.

    hey there.
    Im having problem putting lightbox jquery http://www.lokeshdhakar.com/projects/lightbox2/ and liScrow: http://www.gcmingati.net/wordpress/w...llanimate.html in the same page.
    My LiScrow was working and when I included lightbox script, it stopped to work and lightbox is working fine!
    I also tried with slimbox2 and it happen the same thing!
    I find out that when I take this script out: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    The LiScrow starts to work again, but than slimbox2 stops to work.
    Does any one knows why Im having this problem?
    thank you.
    Mariana
    Last edited by mariana villas boas; 08-02-2011 at 07:12 PM.

  2. #2
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey there! Just found out it. It was a jquery library conflict!!
    thank any way!

  3. #3
    Join Date
    Oct 2007
    Location
    Statline, Nevada usa
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mariana villas boas View Post
    hey there! Just found out it. It was a jquery library conflict!!
    thank any way!
    Hi. Would you mind please posting your solution and sources? Thanks.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,127
    Thanks
    44
    Thanked 3,228 Times in 3,189 Posts
    Blog Entries
    12

    Default

    They may not have resolved it. If you're using Lightbox 2.05 and only need prototype/scriptaculous for it, I'd recommend changing to Slimbox, see:

    http://www.dynamicdrive.com/forums/blog.php?b=247

    If you need prototype/scriptaculous for other things. Your jQuery code will need to be put into noConflict mode. How that's done varies. In many cases external jQuery scripts are already noConflict ready. If so all one needs to do is to put the tag for jQuery and the the scripts that use it before prototype/scriptaculous and add:

    Code:
    <script type="text/javascript">
    jQuery.noConflict();
    </script>
    before prototype.

    Oh, and if you have an init like:

    Code:
    $(document).ready(function(){
    	whatever . . .
    });
    Make it:

    Code:
    jQuery(document).ready(function($){
    	whatever . . .
    });
    With certain jQuery scripts there can be other considerations. That and the fact that using Slimbox - if it eliminates the need for prototype/scriptaculous, saves so much on loading time, is why I would recommend converting to Slimbox in most cases.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Oct 2007
    Location
    Statline, Nevada usa
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey John, ...don't know how this fell through the cracks... just want to say thank you very much for following up with that.
    Cheers, TwoHawks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •