0

I'm running two scripts, one that only works using jQuery 1.4 and another that needs 1.6 to work correctly. I'm sure there is some obvious (to someone who knows) syntax change or something in between the versions but I cannot figure it out.

This is the 1.4 script: http://demo.marcofolio.net/slot_machine/ and if you view the demo there are two bits JS files in the source. The other script that needs 1.6 is the jQuery isotope plugin: http://isotope.metafizzy.co. So I guess I'm asking how to make the 1.4 script 1.6 compatible.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Converting from 1.4 to 1.6 will cause NO problems and requires nothing. Just call 1.6 lib – Alaa Badran Jul 30 '12 at 10:57
  • I have tried changing to 1.6, but the slot machine effect stops working if I do that. If i leave it on 1.4 the slot machine effect works and the gallery half works - it loads up with 1px images until i run a filter and then it sorts itself out – user1562703 Jul 30 '12 at 11:35

1 Answers1

0

Learn About jQuery.noConflict() while using multiple jQuery libraries.

Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If we need to use another JavaScript library alongside jQuery, we can return control of $ back to the other library with a call to $.noConflict():

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

See this post also Can I use multiple versions of jQuery on the same page?

Community
  • 1
  • 1
Ahsan Khurshid
  • 9,383
  • 1
  • 33
  • 51