Prevent Firefox Logo Dragging

Guides & Snippets for phpBB3. Try the Snippets here and share Your own Snippets
There is no support here! Only Read Access!
Locked
User avatar
Post Bot
BBCoder II
BBCoder II
Posts: 44
Joined: 04 Mar 2010, 20:53

Prevent Firefox Logo Dragging

Post 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()"
User avatar
Georgio
BBCoder II
BBCoder II
Posts: 53
Joined: 06 Mar 2010, 19:10
Location: Cabanes, Spain
Contact:

Re: Prevent Firefox Logo Dragging

Post 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 1896 times
User avatar
Nully
Donator
Donator
Posts: 258
Joined: 15 Mar 2010, 00:03
BBCodes: 10
Favourite MOD: Radios
Location: France > Bulgaria
Contact:

Re: Prevent Firefox Logo Dragging

Post 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. :(
User avatar
djs596
BBCoder II
BBCoder II
Posts: 8
Joined: 05 Mar 2010, 01:39
BBCodes: 0
Favourite BBCode: Any that I've made :P
Favourite MOD: Arcade
Location: UK

Re: Prevent Firefox Logo Dragging

Post by djs596 »

Yep, this cannot prevent right click :)
User avatar
Nully
Donator
Donator
Posts: 258
Joined: 15 Mar 2010, 00:03
BBCodes: 10
Favourite MOD: Radios
Location: France > Bulgaria
Contact:

Re: Prevent Firefox Logo Dragging

Post 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
Locked