2016-03-31 11 views
0

immer diese Fehlermeldung:Magento Prototype Fehler

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 

Ich denke, es ist ein jquery Konflikt Problem sein könnte, könnte jemand empfehlen, etwas zu überprüfen.

EDIT:

Der Fancybox Code aufgerufen hier wird:

$('.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); 
    }); 

Irgendwelche Ideen auf, was es das ist, sein könnte, verursacht dies nicht zu arbeiten?

Danke

+0

Könnten Sie bitte einen Code schreiben, wo diese Funktion $ (...) ist. Fancybox uesd –

+0

Sicher ist, bearbeitete Hauptfrage. –

Antwort

0

Versuchen Sie, jQuery im Konfliktmodus auszuführen. Dies wird mögliche Konflikte mit Prototype stoppen.

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

Dann Fancy Box Arbeits Verwendung jQuery statt $ zu bekommen. So

jQuery ('sm_quickview_handler'). Fancybox .....

0

Legen Sie die folgende Zeile vor Ihrem fancybox jquery Start.

jQuery.noConflict();

Alle ersetzen alle $ mit jQuery

Dank