jQuery中的.on()改写.bind()、.live()、.
作者:
九又四分之三o | 来源:发表于
2017-09-22 09:30 被阅读0次/* The jQuery .bind(), .live(), and .delegate() methods are just one
line pass throughs to the new jQuery 1.8.2 .on() method */
// Bind
$( "#members li a" ).on( "click", function( e ) {} );
$( "#members li a" ).bind( "click", function( e ) {} );
// Live
$( document ).on( "click", "#members li a", function( e ) {} );
$( "#members li a" ).live( "click", function( e ) {} );
// Delegate
$( "#members" ).on( "click", "li a", function( e ) {} );
$( "#members" ).delegate( "li a", "click", function( e ) {} );
本文标题:jQuery中的.on()改写.bind()、.live()、.
本文链接:https://www.haomeiwen.com/subject/uckeqxtx.html
网友评论