jQueryによる右クリック保存とドラッグ&ドロップの禁止
$(function(){
$('img').attr('onmousedown', 'return false');
$('img').attr('onselectstart', 'return false');
$('img').attr('oncontextmenu', 'return false');
});
特定要素の画像を除外して、右クリック保存とドラッグ&ドロップの禁止
menuクラスのimg以外の画像を右クリック保存禁止
$(function(){
$('img').not('.menu img').attr('onmousedown', 'return false');
$('img').not('.menu img').attr('onselectstart', 'return false');
$('img').not('.menu img').attr('oncontextmenu', 'return false');
});
コメント