Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7177467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:43:10+00:00 2026-05-28T16:43:10+00:00

I am trying to use Lightbox plugin but with jquery there is a conflict

  • 0

I am trying to use Lightbox plugin but with jquery there is a conflict and gone through some articles and find out to get work around this but I have no luck in implementing it.

Here is my code:
References:

<link href="Lightbox/css/lightbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Lightbox/js/prototype.js"></script>
<script type="text/javascript" src="Lightbox/js/scriptaculous.js?load=effects,builder">    </script>
<script type="text/javascript" src="Lightbox/js/lightbox.js"></script>

Script:

<script type="text/javascript">
    jQuery.noConflict();
    (function ($) {
        $(document).ready(function () {
            $("a[rel=lightbox[group1]]").live("click", function () {
                $("a[rel^='lightbox[group1]']").lightbox();
                return false;
            });
        });
    })(jQuery);
</script>

Any help will be greatly appreciated!

I am using jquery 1.5.2 version

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:43:13+00:00Added an answer on May 28, 2026 at 4:43 pm

    To prevent $ conflicts between jQuery and prototype, you have to put jQuery.noConflict(); right after you include jQuery and before any other code that expects $ to belong to another library. Then, once you’ve done that, $ will not map to jQuery, it will be used by the other libraries.

    You don’t show how you include jQuery. Here’s an example right from the jQuery doc page for .noConflcit():

    <script type="text/javascript" src="other_lib.js"></script>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
      $.noConflict();
      jQuery(document).ready(function($) {
        // Code that uses jQuery's $ can follow here.
      });
      // Code that uses other library's $ can follow here.
    </script>
    

    In your case, I think your code would go like this:

    <link href="Lightbox/css/lightbox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Lightbox/js/prototype.js"></script>
    <script type="text/javascript" src="Lightbox/js/scriptaculous.js?load=effects,builder">    </script>
    <script type="text/javascript" src="Lightbox/js/lightbox.js"></script>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
        jQuery.noConflict();
        (function ($) {
            $(document).ready(function () {
                $("a[rel=lightbox[group1]]").live("click", function () {
                    $("a[rel^='lightbox[group1]']").lightbox();
                    return false;
                });
            });
            // other jQuery code that uses $ can go here
        })(jQuery);
        // other jQuery code that uses jQuery (but not $) can go here or in other script tags
    </script>
    

    The order of including js files in relation to the call to jQuery.noConflict() is critically important.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the Fancy Zomm jQuery plugin to show multiple images in
I am trying use Thread but i have some problem (I am beginner at
I am trying use the jQuery table sorter plugin for a table that is
I'm pulling my hair out trying to find a simple jquery gallery. I must
I am trying to get a jQuery lightbox, Yoxview, to integrate with a Coverflow
Trying to use a guid as a resource id in a rest url but
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
I am trying to implement the jQuery plugin, prettyPhoto, on my page. I used
I'm trying to use Lightbox with my CodeIgniter application. Lightbox says to put the
I am trying use javascript regular expressions to do some matching and I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.