Heim > Artikel > Web-Frontend > Detaillierte Erläuterung der Live-Bindung mehrerer Ereignisse in jQuery
Vor 1.4.0 (außer 1.4.0) können nicht mehrere Bindungen verwendet werden. Ein einzelnes Beispiel ist:
$('.clickme').live('click', function() { // Live handler called. });
1.4.0-1.4.2 hat begonnen, es zu unterstützen wie folgt:
bjbzj.codeplex.com; shbjz.codeplex.com; tjbjz.codeplex.com; cqbjz.codeplex.com; hebbjz.codeplex.com; jlbjz.codeplex.com; sybjz.codeplex.com; dlbjz.codeplex.com; asbjz.codeplex.com; jnbjz.codeplex.com; qdbjz.codeplex.com; zbbjz.codeplex.com; dybjz.codeplex.com; ytbjz.codeplex.com; wfbjz.codeplex.com; tybjz.codeplex.com; xamjz.codeplex.com; sjzmt.codeplex.com; tsmt.codeplex.com; qhdmt.codeplex.com; lybjz.codeplex.com; zzmt.codeplex.com; whmt.codeplex.com; csbjz.codeplex.com; wxbjz.codeplex.com; njbjz.codeplex.com; szbjz.codeplex.com; nbbjz.codeplex.com; hzbjz.codeplex.com; fzbjz.codeplex.com; xmbjz.codeplex.com; kmbjz.codeplex.com; cdbjz.codeplex.com; hfbjz.codeplex.com; gybjz.codeplex.com; xzbjz.codeplex.com; ntbjz.codeplex.com; jsbjz.codeplex.com; zjbjz.codeplex.com; yzbjz.codeplex.com; ncbjz.codeplex.com; gzbjz.codeplex.com; szjzb.codeplex.com; zsbjz.codeplex.com; stbjz.codeplex.com; fsbjz.codeplex.com; lzbjz.codeplex.com; zhbjz.codeplex.com; hzmt.codeplex.com; ycbjz.codeplex.com; xnbjz.codeplex.com; whjz.codeplex.com; czmt.codeplex.com; bjbjz.codeplex.com; shmt.codeplex.com; tjjz.codeplex.com; cqjz.codeplex.com; hebjz.codeplex.com; jljz.codeplex.com; syjz.codeplex.com; dljz.codeplex.com; asjz.codeplex.com; jnjz.codeplex.com; qdjz.codeplex.com; zbjz.codeplex.com; dyjz.codeplex.com; ytjz.codeplex.com; wfjz.codeplex.com; tyjz.codeplex.com; xajz.codeplex.com; sjbjz.codeplex.com; tsjz.codeplex.com; qhbjz.codeplex.com; lyjz.codeplex.com; zzjz.codeplex.com; whbz.codeplex.com; csjz.codeplex.com; wxjz.codeplex.com; njjz.codeplex.com; szjz.codeplex.com; nbjz.codeplex.com; hzjz.codeplex.com; fzjz.codeplex.com; xmjz.codeplex.com; kmjz.codeplex.com; cdjz.codeplex.com; hfjz.codeplex.com; gyjz.codeplex.com; xzjz.codeplex.com; ntjz.codeplex.com; jhjz.codeplex.com; zjjz.codeplex.com; yzjz.codeplex.com; ncjz.codeplex.com; gzjz.codeplex.com; szgjz.codeplex.com; zsjz.codeplex.com; stjz.codeplex.com; fsjz.codeplex.com; lzjz.codeplex.com; zhjz.codeplex.com; fzmjz.codeplex.com; ycjz.codeplex.com; xnjz.codeplex.com; whmjz.codeplex.com; czjz.codeplex.com; $('.hoverme').live('mouseover mouseout', function(event) { if (event.type == 'mouseover') { // do something on mouseover } else { // do something on mouseout } });
Versionen nach 1.4.3 beginnen, eine andere Methode der Aktualisierung zu unterstützen:
$('a').live({ click: function() { // do something on click }, mouseover: function() { // do something on mouseover } }); //鼠标移入移出事件 $(document).ready(function(){ $('.title span').live({ mouseenter:function(){ alert('enter'); }, mouseleave:function(){ alert('leave'); } }); });
Das obige ist der detaillierte Inhalt vonDetaillierte Erläuterung der Live-Bindung mehrerer Ereignisse in jQuery. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!