使用jQuery绑定事件(mousedown + mouseover)

时间:2013-07-23 17:00:54

标签: javascript jquery

当鼠标悬停在执行操作的元素上时,如何使用jQuery进行绑定。 ?我的代码

$("div").bind('mouseover',function(){

  my_function();

});

2 个答案:

答案 0 :(得分:1)

    $("#elementID").on('mouseover', function(event) {
        //code goes here
    });

您应该使用.on()而不是.bind();

http://api.jquery.com/on/

答案 1 :(得分:-1)

 $("seletor").bind('mouseover', function(event) {

 });
相关问题