Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 09-21-2004, 04:11 PM Alert
statesbo's Avatar
Novice Talker

Posts: 14
Trades: 0
This script produces the "silent" no right click. I need it to serve an alert. Can this be done?

var disableRightClickString = "<script>function disableRightClick(e){if(document.layers){document. captureEvents(Event.MOUSEDOWN);document.onmousedow n = disableRightClick; }else document.oncontextmenu = disableRightClick; return document.rightClickDisabled = true;} disableRightClick(); </script>";


Thanks
statesbo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-21-2004, 04:48 PM
techwench's Avatar
Code Monkey

Posts: 1,449
Name: Danalyn
Location: Dallas, TX
Trades: 0
Code:
<script language="JavaScript">
function click() {
if (event.button==2) {
alert('Cut it out!!!');
}
}
document.onmousedown=click
// -->
</script>
But, IMO, these are really annoying...especially since I can still right-click (FF extensions are great)...and if someone really wanted your stuff, they can get it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
techwench is offline
Reply With Quote
View Public Profile
 
Old 09-21-2004, 05:04 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
Yup, they're pretty much useless. So I can't right click... big deal. There's so many ways around it that it's not even worth the programming effort to prevent right clicks.
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 09-21-2004, 08:58 PM
statesbo's Avatar
Novice Talker

Posts: 14
Trades: 0
Yeah, I know. I told the client that but he insists he wants it. I think he wants it more to put a quirky message in the alert box than to actually protect the images.

Thanks for the scrip above, but I think I really need to alter the actual code in the post.

The full script is a image gallery with scrolling thumbnails that works with a source script and an include script within the HTML. Since the script uses I-frames to serve the images, disabling right click on the page won't work.

The script I used above is a piece from the source script, If I don't use it as the base I break the script.

I'll post a link to the page if it helps, but I'm not sure about the spam rules on this forum.

Last edited by statesbo; 09-21-2004 at 09:06 PM..
statesbo is offline
Reply With Quote
View Public Profile
 
Old 09-21-2004, 09:40 PM
techwench's Avatar
Code Monkey

Posts: 1,449
Name: Danalyn
Location: Dallas, TX
Trades: 0
You can post a link to the site because it pertains to your coding question.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
techwench is offline
Reply With Quote
View Public Profile
 
Old 09-21-2004, 09:44 PM
statesbo's Avatar
Novice Talker

Posts: 14
Trades: 0
Thanks

http://www.912-352-7880.com/artists/chris



**little warning**

The link above is fine, but if you get to looking around, know that the piercing gallery gets a little raunchy.
statesbo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Alert
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18190 seconds with 12 queries