通常のevent設定 $('#id').bind('click',function(ev){ console.info('clicked'); }); // #idの要素click時に"clicked"と表示 $('#id').trigger('click'); // "clicked"と表示
通常のevent設定 $('#id').bind('click',function(ev){ console.info('clicked'); }); // #idの要素click時に"clicked"と表示 $('#id').trigger('click'); // "clicked"と表示
Event delegation, as described in the first article of this series, is a way to take advantage of event bubbling to avoid binding an event listener more than once. jQuery 1.3 and the upcoming jQuery 1.4 have many features that make using event delegation in your web pages easier. The aim of this tutorial is to help you understand how these new features work. From traditional event listening to eve
夢で医者にギブスくらい自分ではずせよと言われました。agoです。 昨日若手IT勉強会に参加させていただき、jQuery.live周辺とjsdeferredを読んできました。 そのとき気づいたのですが、Firefoxはdocument objectに対するclick eventが右クリック(event.button === 2)時にも呼ばれてしまうようです。(Firefox ver 3.5.5で確認) (Fxの方はデモコードの「ここをクリック!」を右クリックしていただければ確認できると思います) 本家にはすでに報告されているようなのでいずれ修正されると思いますが、jQuery ver 1.3.2以下で$().liveを使用する場合以下のようにコード側で対応することをお奨めします。 $('selector').live('click', function (env) { if (env.but
jQueryでサポートされたliveなイベントがどういう風に実現されているのか調べた。かなり複雑だったので詳細は追わなかったが、このようにしているようだ。 var live = function (selector, type, fun) { document.addEventListener( type, function (e) { var elem = e.target; var isMatch = Array.prototype.some.call( document.querySelectorAll(selector), elem.isSameNode, elem ); if (isMatch) { if (!fun.call(elem)) e.preventDefault(); } }, false ); }; live('body a', 'click', function
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く