2016-03-31 9 views
0

はこのエラーを取得:Magentoのプロトタイプエラー

prototype.js:5653 Uncaught TypeError: element.attachEvent is not a function 
prototype.js:2304 Uncaught TypeError: Cannot read property 'length' of undefinedElement.Methods.hasClassName 
prototype.js:5653 Uncaught TypeError: element.attachEvent is not a function 
prototype.js:5653 Uncaught TypeError: element.attachEvent is not a function 
prototype.js:5644 Uncaught TypeError: element.attachEvent is not a function 
prototype.js:5734 Uncaught TypeError: element.dispatchEvent is not a function 
kam-black-cargo-trousers-38-inch-leg:2904 Uncaught TypeError: $(...).fancybox is not a function 

私は誰がチェックするために何かを提案することができ、それは、jqueryの紛争問題になることができると思います。

EDIT:

Fancyboxコードはここに呼ばれている:

$('.sm_quickview_handler').fancybox({ 
      title: null, 
      width    : '75%', 
      height    : '90%', 
      autoSize   : 1, 
      scrolling   : 'auto', 
      type    : 'ajax', 
      openEffect   : 'fade', 
      closeEffect  : 'fade', 
      helpers   :{ 
             overlay : { 
         showEarly : true 
        } 
           }, 
      beforeShow : function(){ 
       var $this = this.element, _parent = $('.quickview-main'); 
        if(_parent.length > 0){ 
         var _price_box = _parent.find('.price-box'); 
         if(_price_box.length > 0){ 
          if($('[id]',_price_box).length > 0){ 
           $('[id]',_price_box).each(function(i, el){ 
            var id_price = $(el).attr('id'); 
             $(el).attr('data-idprice',id_price); 
             $(el).attr('id',id_price+'_clone'); 
           }); 
          } 
         } 
        } 
        if(typeof product_zoom){ 
         product_zoom = 'undefined'; 
        } 
      }, 
      afterShow  : function(){ 
       if(_check_tem_def){ 
        product_zoom_ = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint'); 
       } 
       if(_ceck_tem_rwd){ 
        ProductMediaManager.initZoom(); 
        ProductMediaManager.wireThumbnails(); 
       } 
       if(typeof initcajax != 'undefined' && $.isFunction(initcajax)){ 
        initcajax(); 
       } 

       if(typeof updateProductCompareLinks != 'undefined' && $.isFunction(updateProductCompareLinks)){ 
        updateProductCompareLinks(); 
       }else{ 
        $("a.link-compare").on ("click",function(e){ 
          e.preventDefault(); 
          urlcompare = $(this).attr("href"); 
          urlcompare = urlcompare.replace("catalog/product_compare/add","quickview/index/compare"); 
          window.location = urlcompare; 
          return false; 
         }); 
       } 

       if(typeof updateWishlistLinks != 'undefined' && $.isFunction(updateWishlistLinks)) { 

        if(enable_ajax_wishlist){ 
        updateRemoveWishLinks(); 
        if(islogin=="1"){ 
         //setInterval("updateWishlistLinks()",100);} 
         updateWishlistLinks(); 
        } 
        updateWishlistAddCartLinks(); 
        } 
       } 
      }, 
      beforeClose : function() { 
       if(_check_tem_def){ 
        product_zoom_ = 'undefined'; 
       } 
       if(_ceck_tem_rwd){ 
        ProductMediaManager.destroyZoom(); 
       } 
      }, 
      afterClose : function(){ 

      } 
     }); 

     setInterval(function(){ _SmQuickView(); } ,1000); 
    }); 

それが何ができるか上の任意のアイデアがthatsのは、これが動作しない原因?

ありがとうございます。

+0

をすべて$を交換しますが、この関数は$(...)でコードを投稿してくださいでした。fancyboxは –

+0

確かにuesdされ、編集された主な質問。 –

答えて

0

jQueryを競合モードで実行してみてください。これにより、Prototypeとの潜在的な競合が防止されます。

https://api.jquery.com/jquery.noconflict/

は、次に$の代わりにファンシーボックスワーキング使用のjQueryを取得します。だから、

のjQuery( 'sm_quickview_handler')。fancybox .....

0

置きますfancyboxのjqueryの開始前に次の行。

jQuery.noConflict();

すべてのjQueryを使って

おかげ