Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/468.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jquery在滚动后更新dom_Javascript_Jquery_Html - Fatal编程技术网

Javascript Jquery在滚动后更新dom

Javascript Jquery在滚动后更新dom,javascript,jquery,html,Javascript,Jquery,Html,类jquery悬停函数在滚动后工作 $(document).ready(function() { $('img').hover(function(){ alert('hello'); },function(){ alert('hello not'); }); }); 在第一个站点上加载的悬停图像显示警报hello,但在滚动图像加载(lazzy加载)之后。悬停这些图像时,不会显示警报 您需要授权: $(document).ready(fun

类jquery悬停函数在滚动后工作

$(document).ready(function() {
    $('img').hover(function(){
        alert('hello');
    },function(){
        alert('hello not');
    });
});
在第一个站点上加载的悬停图像显示警报hello,但在滚动图像加载(lazzy加载)之后。悬停这些图像时,不会显示警报

您需要授权:

$(document).ready(function() {
    $(document).hover('img', function(){
        alert('hello');
    },function(){
        alert('hello not');
    });
});

这应该在加载新图像后起作用

$(document).ready(function() {

    $("body").on("mouseenter", "img", function(){
        alert('hello');
    });

    $("body").on("mouseleave", "img", function(){
        alert('hello not');
    });

});
用于动态元素。。。