1、关于Jquery中的bind方法:

  最基本的用法:

$("div").bind('click‘,function(){

//some codes

}');

然后可以有同时注册几个方法

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

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

}');

上面这个写法等同于:

$(function(){

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

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

  }');

  $("div").bind('mouseout’,function(){

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

  }');

});

同时还可以添加命名的空间:

$(function(){

  $('div').bind('click.plugin',function(){

    //somecodes

  });

  $('div').bind('mouseout.plugin',function(){

    //somecodes

  });

  $('button').click(function(){

    $('div').unbind('.plugin');

  });

});

这样就可以把带上.plugin的时间都给注销掉