Page 1 of 1

Prevent Firefox Logo Dragging

Posted: 04 Mar 2010, 22:29
by Post Bot
Prevent Firefox Logo Dragging
Written by djs596

You may be aware that, in Firefox, you can 'drag' images with your mouse. Try it with my avatar >>>>>>>>

If you don't want people to be able to drag your site logo:

Open styles/{YOURSTYLE}/template/overall_header.html

Prosilver

Find:

Code: Select all

<a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
Replace with:

Code: Select all

<a href="{U_INDEX}" title="{L_INDEX}" id="logo" onmousedown="event.preventDefault()">{SITE_LOGO_IMG}</a>
Subsilver2

Find:

Code: Select all

<td><a href="{U_INDEX}">{SITE_LOGO_IMG}</a></td>
Replace with:

Code: Select all

<td><a href="{U_INDEX}" onmousedown="event.preventDefault()">{SITE_LOGO_IMG}</a></td>
You can do this with other images as well. Just add the onmousedown, which is this:

Code: Select all

onmousedown="event.preventDefault()"

Re: Prevent Firefox Logo Dragging

Posted: 21 May 2010, 15:52
by Georgio
Post Bot ยป 04 Mar 2010, 21:29 wrote:Prevent Firefox Logo Dragging
Written by djs596

You may be aware that, in Firefox, you can 'drag' images with your mouse. Try it with my avatar >>>>>>>>

[...]
demo:
file = your avatar drag and drop in to my desktop. using firefox 3.6.3
file = your avatar drag and drop in to my desktop. using firefox 3.6.3
file.jpg (7.18 KiB) Viewed 1897 times

Re: Prevent Firefox Logo Dragging

Posted: 21 May 2010, 23:29
by Nully
Hi !
I'm discovering :o
Does it prevent also from right click ?
A few minutes later :
Ok it works to prevent dragging, but not right click. :(

Re: Prevent Firefox Logo Dragging

Posted: 22 May 2010, 20:31
by djs596
Yep, this cannot prevent right click :)

Re: Prevent Firefox Logo Dragging

Posted: 23 May 2010, 22:49
by Nully
Anyway I inserted the code, but I'm sure nobody of my forum knows that it is possible to drag an image :D