You can use .on()
with a delegated event:
$(document).on("contextmenu","img",function(){ return false;});
문제
I want to disable right clicks on any images.
This works fine, but only for the static images.
$('img').bind('contextmenu', function(
return false;
});
How can I prevent right clicking on images which are added dynamically?
해결책
You can use .on()
with a delegated event:
$(document).on("contextmenu","img",function(){ return false;});