Magento

eCommerce Software for Online Growth

Extension jQuery Base

Last modified by mxperts on Thu, July 16, 2009 06:44
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’s not... cause of an old version of scriptaculous not 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(document).ready(function($){
      // Use jQuery with $(...)
      $('div').show();
  });
  // Use Prototype with $(...)
   $('id').hide();

- 2d way

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

Happy jQuery, jQuery plugins & jQuery UI ;)




 

Magento User Guide

Magento Enterprise Available now

Professional Services from the Magento Team

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
© Copyright 2010 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
177665 users|1093 users currently online|277230 forum posts