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

  • SEARCH
  • Home
  • 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 7711857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:28:54+00:00 2026-06-01T01:28:54+00:00

I have several Jquery libraries and I keep getting conflicts between one or the

  • 0

I have several Jquery libraries and I keep getting conflicts between one or the other. I’m not entirely sure how to resolve these conflicts. I will post up the libraries I have. First I will post the javascript includes I have in my header and the exact order they are in:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script>
    <script type="text/javascript" src="scripts/javascript.js"> </script>
    <script type="text/javascript" src="scripts/prototype.js"></script>
    <script type="text/javascript" src="scripts/scriptaculous.js?load=effects,builder"></script>
    <script type="text/javascript" src="scripts/lightbox.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>        
    <script type="text/javascript" src="scripts/jquery.easing.1.3.js"></script>
    <script type="text/javascript" src="scripts/jquery.mousewheel.min.js"></script>

These are the libraries I am running; this is on the index.html and is for custom scrollbars:

<script>
$(window).load(function() {
mCustomScrollbars();
});

function mCustomScrollbars(){
$("#about").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
$("#graph").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
$("#int").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
$("#arch").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
$("#serv").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
$("#contact").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
}

$.fx.prototype.cur = function(){
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
  return this.elem[ this.prop ];
}
var r = parseFloat( jQuery.css( this.elem, this.prop ) );
return typeof r == 'undefined' ? 0 : r;
}
</script>
<script src="scripts\jquery.mCustomScrollbar.js"></script>

This is for the accordion menu located in the javascript include:

$(document).ready(function() {
$('.portfolio').click(function() {
    $('.accordionContent').slideUp('normal');
    if($(this).next().is(':hidden') == true) {
        $(this).next().slideDown('normal');
     } 
 });    
$('.accordionContent').hide();
});
});

And last but not least the library that indicates which button on the menu to be highlighted (although I won’t post all of it as it is long), also in the javascript include file:

$(document).ready(function() {
$('#about, #graph, #int, #arch, #serv, #contact').hide();

$('#about_button').click(function() {
$(this).removeClass("about").addClass("highlightabout");
$('#graph_button').removeClass("highlightgraph").addClass("graph");
$('#int_button').removeClass("highlightint").addClass("int");
$('#arch_button').removeClass("highlightarch").addClass("arch");
$('#serv_button').removeClass("highlightserv").addClass("serv");
$('#contact_button').removeClass("highlightcontact").addClass("contact");
$('#graph, #int, #arch, #serv, #contact, #box7').hide();
$('#about').show();
                              }
$('#graph_button').click(function() {
$(this).removeClass("graph").addClass("highlightgraph");
$('#about_button').removeClass("highlightabout").addClass("about");
$('#int_button').removeClass("highlightint").addClass("int");
$('#arch_button').removeClass("highlightarch").addClass("arch");
$('#serv_button').removeClass("highlightserv").addClass("serv");
$('#contact_button').removeClass("highlightcontact").addClass("contact");
$('#about, #int, #arch, #serv, #contact, #box7').hide();
$('#graph').show();
});
});

As I understand it I am meant to include jQuery.noconflict() before all or one of these libraries?

Thank you for any help!

UPDATE: The jsfiddle to show my javascript work http://jsfiddle.net/hSRDn/

  • 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-06-01T01:28:55+00:00Added an answer on June 1, 2026 at 1:28 am

    As you are using Prototype, which also defines $ you need to use jQuery.noConflict() as you already mentionend.

    According to jQuerys documentation you have two choices:

    After all libraries were included but before any jQuery code is written, use the noConflict() function:

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

    This means, jQuery gives $ back to prototype. You need to use jQuery instead of $ then. For example:

    <script type="text/javascript">
      $.noConflict();
      // Code that uses other library's $ can follow here.
      jQuery('#some-elemtent').hide(); // jQuery usage
      $('some-element').observe(....) // prototype usage 
    
    </script>
    

    Or, if you only use jQuery within a function scope (e.g. in a document load function) you can bind the $ to it like this:

    <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>
    

    within this function the $ refers to the jQuery definition instead of prototype.

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

Sidebar

Related Questions

I have seen several javascript libraries using $ be it jQuery , mootools ,
I have several jQuery functions on my website but not on every page all
I am using several plugins, custom widgets and some other libraries from JQuery. as
i have the following jquery code. basically i will have several overlapped divs and
An easy jQuery question. I have several identical forms ( except their name )
I am using jQuery 1.7.1 (but that's probably irrelevant). I have several JavaScript arrays
I have several jQuery UI Sliders and I want to collect their values. Thought
I am using ColdFusion (Railo 3.3), and I have several forms using jQuery that
trying to develop web form using jquery. all i need is to have several
I have several dynamically created links and forms on one page named with IDs

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.