Maison >interface Web >js tutoriel >Explication détaillée de la liaison en direct de plusieurs événements dans jQuery
Avant la version 1.4.0 (sauf la version 1.4.0), plusieurs liaisons ne peuvent pas être utilisées. Un seul exemple est :
$('.clickme').live('click', function() { // Live handler called. });
1.4.0-1.4.2 a commencé à le prendre en charge. comme suit :
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 } });
Les versions après 1.4.3 commencent à prendre en charge une autre méthode de mise à jour :
$('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'); } }); });
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!