且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

magento 使用 jquery 与 noconflict

更新时间:2023-09-29 17:50:46

你需要把所有的 $( 替换成 jQuery($.> 进入 jQuery. 中的 jQuery 相关功能和插件.

You need to replace all $( into jQuery( and $. into jQuery. in jQuery related functions and plugins.

例如在您的代码中替换

jQuery('.block_cart_header').hover(function(){
        jQuery('.cart_add_items').fadeIn(700);
    },
    function(){
        jQuery('.cart_add_items').fadeOut(700);
    });

额外信息

您可以更改库文件启动的顺序.在 page.xml 中更改顺序如下

Extra information

You may change the order of library file initiating. In page.xml change order as below

  1. jquery.js
  2. noconflict.js
  3. prototype.js这将避免 IE8 中的错误.

希望能帮到你