infinite scroll javascript already fired

霸气de小男生 提交于 2019-11-29 18:01:54

you should use event delegation with on() method like so

$("body").on("mouseenter", ".list_item_image", function () {
  ...
});

$("body").on("mouseleave", ".list_item_image", function () {
  ...
});

this will attach your handlers also on newer elements injected later on the DOM via ajax

only if you are using an older version of jQuery use delegate(), on() otherwise

Fixed (I hope so anyway)

It seems the js was missing being wrapped in: $(document).ready(function(){ ... });

Thanks for all help.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!