特別なクラス (ライブ) で div の左クリックと右クリックを管理するための優れたソリューションが必要です。
コードがすべての新しいブラウザーで機能することが重要です。
誰かが私を助けてくれることを願っています。
私の最初の試み... //右クリックが機能しません
HTML
<div id="test_one" class="my_class">Click here</div>
<br /><br />
<div id="test_two" class="my_class">Click here</div>
JS
$(document).ready(function test()
{
$(".my_class").bind("contextmenu",function(e){ return false; });
$(".my_class").live('click', function(e)
{
if(e.button == 0 || e.button == 1)
{
alert('L -> '+this.id+'');
}
else if(e.button == 2){
alert('R -> '+this.id+'');
}
});
});
前もって感謝します!ピーター