Welcome to PhpBB3 BBCodes. Click here to register
Feed

Prevent Firefox Logo Dragging

Prevent Firefox Logo Dragging

Postby Post Bot » 04 Mar 2010, 20:29

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

BBCoder II
 
 
Status: Offline
Posts: 44
Topics: 44
Joined: 04 Mar 2010, 18:53

Donate to skip ads


Re: Prevent Firefox Logo Dragging

Postby Georgio » 21 May 2010, 13:52

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.jpg
file = your avatar drag and drop in to my desktop. using firefox 3.6.3
file.jpg (7.18 KiB) Viewed 185 times
User avatar
Georgio

BBCoder II
 
 
Status: Offline
Age: 24
Posts: 53
Topics: 6
Joined: 06 Mar 2010, 17:10
Last Visit: Yesterday, 10:32
Location: Cabanes, Spain
PhpBB Version: 3.0.7-PL1

Re: Prevent Firefox Logo Dragging

Postby Nully » 21 May 2010, 21:29

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
Nully

BBCoder II
 
 
Status: Offline
Posts: 14
Joined: 14 Mar 2010, 22:03
Last Visit: 07 Sep 2010, 12:57
PhpBB Version: 3.0.7-PL1

Re: Prevent Firefox Logo Dragging

Postby djs596 » 22 May 2010, 18:31

Yep, this cannot prevent right click :)
User avatar
djs596

Donator
 
 
Status: Offline
Posts: 1
Joined: 04 Mar 2010, 23:39
Last Visit: 30 Aug 2010, 19:20
PhpBB Version: 3.0.7-PL1

Re: Prevent Firefox Logo Dragging

Postby Nully » 23 May 2010, 20:49

Anyway I inserted the code, but I'm sure nobody of my forum knows that it is possible to drag an image :D
User avatar
Nully

BBCoder II
 
 
Status: Offline
Posts: 14
Joined: 14 Mar 2010, 22:03
Last Visit: 07 Sep 2010, 12:57
PhpBB Version: 3.0.7-PL1

Donate to skip ads



Return to Snippets



  • Similar topics
    Replies
    Views
    Last Post

Who is online

Users browsing this forum: Stark and 0 guests