javascript - jquery.min.js conflicting with 1.6.2 jquery.min.js from googleapis -


i'm using <script src="js/jquery.min.js"></script>for slider , many other functionalities. i'm using <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> gallery.

everything seems work when add 1.6.2 jquery.min.js googleapis stops everything, including sliders , smooth scrolling. thing working gallery.

here's code:

<link href="css/bootstrap.css" rel='stylesheet' type='text/css' /> <link rel="stylesheet" type="text/css" href="css/jquery.jscrollpane.css" media="all" /> <script src="js/jquery.min.js"></script> <link href="css/style.css" rel='stylesheet' type='text/css' /> <script type="text/javascript" src="js/move-top.js"></script> <script type="text/javascript" src="js/easing.js"></script> <script type="text/javascript" src="js/jquery.flexisel.js"></script> <script type="text/javascript">         jquery(document).ready(function($) {             $(".scroll").click(function(event){                      event.preventdefault();                 $('html,body').animate({scrolltop:$(this.hash).offset().top},1000);             });         });     </script>  

in body have code:

<script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <!-- jscrollpane script --> <script type="text/javascript" src="js/jquery.mousewheel.js"></script> <script type="text/javascript" src="js/jquery.contentcarousel.js"></script> <script type="text/javascript"> $('#ca-container').contentcarousel(); </script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 

this 1 that's causing conflict, have tried put in head did not make difference:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 

thank assistance!

in general should avoid using 2 different versions of jquery on same page. of time won't need - largely backwards compatible. try putting newer of 2 versions of jquery first, removing other one. js/jquery.min.js newer version, try removing google ajax apis 1 completely.

if using broken new version of jquery, check there hasn't been new version of thing released. if there hasn't, try fix work new jquery.

the next option check if there older version of thing requires new jquery might work older jquery version.

if none of options work, can try use 2 versions of jquery on page using jquery.noconflict(), not recommended. after load first version , before load second, like:

j = jquery.noconflict(); 

then use j instead of $ whenever want use version of jquery, , $ second version.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -