Dom レベル 2 のイベント モデルには、イベント キャプチャとイベント バブルが存在することはわかっています。しかし、jqueryがそれらをどのように処理するかわかりません。そこで、その.bind方法でいくつかの実験を行いました。これが私のコードです。確認してください。
<script>
    $(function() {
        $('*').each(function(){
            var current = this;
            $(this).bind("dblclick",function(event){console.log('Capture for ' + current.tagName + '#'+ current.id +
                    ' target is ' + event.target.id);});
        });
    });
</script>
<body id="greatgrandpa">
    <div id="grandpa">
        <div id="pops">
            <img id="example" src="designer/templates/thumbnails/2ColsTemplate.PNG" />
        </div>
    </div>
</body>
出力は以下のようになります
Capture for IMG#example target is example
Capture for DIV#pops target is example
Capture for DIV#grandpa target is example
Capture for BODY#greatgrandpa target is example
Capture for HTML# target is example
event.stopPropagation();イベントハンドラーを使用すると、イベントのバブルが停止しdblclickます。
しかし、それには 2 つの質問があります。ログの書き込み順序によると、bindメソッドは、イベント キャプチャ (ドームの上部から下部) ではなく、イベント バブル (ドームの下部から上部) でイベントをトリガーすると推測しました。もう 1 つの質問は、イベント キャプチャ期間にイベントがトリガーされる可能性はありますか? ありがとう。
ありがとう。