2012-03-28, 17:33:46
Zegnåt Wrote:Your problem is that $('img') only contains the images that currently exist in the DOM. Fancybox creates a new IMG element when it shows its box, and this new image never got your function set to it. What you actually want to do is bind the action to an existing element like the document but only trigger it when an image is clicked. Like so:
Code:$(function(){
$(document).on('contextmenu', 'img', function(){ return false; });
});
I still do not agree with this, but there you go. You can change the img selector in the .on() function to something more specific if you only want this to apply to images shown in Fancybox.
Okej, tack ska du ha!
I'll try with this.
The site owner wants some protection for images - I haven't such a strong opinion on this one, I guess if it were my site I wouldn't bother to ttry to disable anything :-)
EDIT:
Did not disable right click on Fancybox popup...
I'll try to sort it out...