jQuery error TypeError: $.event.handle is undefined

后端 未结 2 1787
南方客
南方客 2021-01-02 09:30

I am using latest jQuery for jQuery.masonry its throwing following error: on line 47 in jquery-1.9.1.min.js

TypeError: $.event.handle is undefined

相关标签:
2条回答
  • 2021-01-02 10:00

    You are trying to use :

    var $newElems = $( newElements ).css({ opacity: 0 });
    

    as an element :

    $newElems.imagesLoaded
    

    Maybe this is the problem.

    A solution would be :

     var $newElems = $( newElements );
     $newElems.css({ opacity: 0 });
    
    0 讨论(0)
  • 2021-01-02 10:04

    The function has been deprecated: http://jquery.com/upgrade-guide/1.9/#other-undocumented-properties-and-methods

    You can use $.event.dispatch instead.

    In addition or alternatively to using the dispatch function you can add the Migrate plugin, http://blog.jquery.com/2013/05/01/jquery-migrate-1-2-0-released/, which will add back in $.event.handle so you able to fix the code without breaking the application.

    0 讨论(0)
提交回复
热议问题