Try the Demo

Magento

eCommerce Software for Online Growth

Extension jQuery Base

Last modified by wayneIntacart on Tue, September 13, 2011 11:27
Source|Old Revisions  

Extension jQuery Base

NEW: Extension jQuery Base is available in Magento Connect http://www.magentocommerce.com/extension/1619/mxperts--jquery-base

Intro

jQuery can be easily used with other libraries so it should work out of the box with Magento. But in fact, it doesn’t because Magento uses an old version of scriptaculous that wasn’t written with other libraries in mind.

How To

Scriptaculous

<action method="addJs"><script>scriptaculous/effects.js</script></action>

to

<action method="addJs"><script>scriptaculous/effects-1.8.1.js</script></action>

jQuery

jQuery.noConflict();
  • Rename the file to jquery-1.2.6.noConflict.min.js
  • Copy the file to the directory js/jquery/
  • In page.xml, add it to the list of js files:
<action method="addJs"><script>jquery/jquery-1.2.6.noConflict.min.js</script></action>

Use it

- 1st way (notice the function($))

  jQuery(function($){
      // Use jQuery with $(...)
      $('div').show();
  });
  // Use Prototype with $(...)
   $('id').hide();

- 2d way

jQuery(function(){
    // Use Prototype with $(...)
    $('id').hide();
    // Use jQuery with jQuery(...)
    jQuery('div').show();
});

Happy jQuery, jQuery plugins & jQuery UI ;)




 

Introducing Magento Go

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|1037 users currently online|497254 forum posts