Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Pimp My Site! > Right Click block?
Leatah Rootbreaker (New Admin) 12/12/2006 10:52 AM EST : Right Click block?
Leatah Rootbreaker
Posts: 570
Zomgawsh Poster

Is it possible to put code in to block right clicks for copying text or saving pictures?  I looked through the posts and may have missed it somewhere, but I don't think I saw anything.
TopBottom

538250866_Inactive (New Admin) 12/13/2006 6:45 PM EST : RE: Right Click block?
538250866_Inactive
Posts: 135
Posts With Wolves

Yes it is possible heres a bit of code u can use.  This will prevent them from right clicking anywhere on the page

Just put the other < on the side of the tags to get them to work

html>
script language=JavaScript>

document.oncontextmenu=new Function("alert(message);return false")

var message="Function Disabled";

/script>
/html>
TopBottom

Guppy Queen (New Admin) 12/14/2006 3:02 AM EST : RE: Right Click block?
Guppy Queen
Posts: 41034
Zomgawsh Poster

That would block them from using the mouse to right click for copying, but on the Mac platform they can drag and drop the image on the desktop.
TopBottom

graysoth (New Admin) 12/14/2006 3:48 AM EST : RE: Right Click block?
graysoth
Posts: 1493
Zomgawsh Poster

Where do I put that code in? I'm more of an art person, I can draw the stuff, just the code thing I'm still learning. Thanks for your help.
TopBottom

538250866_Inactive (New Admin) 12/14/2006 5:13 AM EST : RE: Right Click block?
538250866_Inactive
Posts: 135
Posts With Wolves

Good point guppy I didnt think about that, ill come up with something in a bit

If you want to have the no right click on all of your pages I would recommend that you put the code in either your custom banner area code or in your boiler plate code areas,  If you just want it on a perticular page simply paste the code into a html/text content box
TopBottom

Leatah Rootbreaker (New Admin) 12/15/2006 9:24 AM EST : RE: Right Click block?
Leatah Rootbreaker
Posts: 570
Zomgawsh Poster

Thank you soo much for the reply!  I appreciate the help!
TopBottom

538250866_Inactive (New Admin) 12/20/2006 7:35 PM EST : RE: Right Click block?
538250866_Inactive
Posts: 135
Posts With Wolves

Ok guppy heres what you wanted a code that would prevent a mac from simply draging the picture off.  All this code does is simply put a transparent gif image over your image.  The image i used can be found here.

html>
img src="yourimage url" width="100" height="50">

img src="transparent.gif url" width="100" height="50" style="position:relative; left:-102px; top:0px;">

/html>
TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%