Is it possible to use jQuery .on and hover?

前端 未结 10 927
失恋的感觉
失恋的感觉 2020-11-22 11:03

I have a

    that is populated with javascript after the initial page load. I\'m currently using .bind with mouseover and
10条回答
  •  青春惊慌失措
    2020-11-22 11:42

    You can provide one or multiple event types separated by a space.

    So hover equals mouseenter mouseleave.

    This is my sugession:

    $("#foo").on("mouseenter mouseleave", function() {
        // do some stuff
    });
    

提交回复
热议问题