jQuery中bind函数绑定多个事件

名人名言:道德是真理之花。——雨果

在jQuery中绑定多个事件名称是,使用空格隔开,举例如下:

$("#foo").bind("mouseenter mouseleave", function() {

  $(this).toggleClass("entered");

});

在1.4版本以后,也可以如下绑定

$("#foo").bind({

  click: function() {

    // do something on click

  },

  mouseenter: function() {

    // do something on mouseenter

  }

});
原文地址:https://www.cnblogs.com/hellowzd/p/4516262.html