Reply
how can i cance mouse click events.
Old 01-24-2007, 01:18 AM how can i cance mouse click events.
Average Talker

Posts: 28
Name: dinesh s
hi
i want to cancel all the mouse click events in my page(in firefox).
is it possible.
thanks..
dinesh s is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-24-2007, 04:44 AM Re: how can i cance mouse click events.
bbutton's Avatar
Experienced Talker

Posts: 43
Name: Bill Button
Location: Reading,UK
HI,

A quick search on google found the following

http://www.rgagnon.com/jsdetails/js-0061.html
http://www.todaysteacher.com/web2/norightclick.htm

Regards
Bill Button
http://www.rodmatic.com
bbutton is offline
Reply With Quote
View Public Profile Visit bbutton's homepage!
 
Old 01-24-2007, 05:15 AM Re: how can i cancel mouse click events.
Average Talker

Posts: 28
Name: dinesh s
hello sir,
thank u very much sir.its working well , but not working with my code.

i will try to make it work.
iam new to programming world.so i need ur help, plz.......

Thank you sir.
dinesh s is offline
Reply With Quote
View Public Profile
 
Old 01-24-2007, 05:40 AM Re: how can i cance mouse click events.
Average Talker

Posts: 28
Name: dinesh s
hello sir,
it works fine in IE but not working in Firefox.
dinesh s is offline
Reply With Quote
View Public Profile
 
Old 01-24-2007, 09:43 AM Re: how can i cance mouse click events.
Mattmaul1992's Avatar
Ultra Talker

Posts: 440
Name: Matt
I'm not sure that this should be in the ASP (Active Server Page) problem because even if ASP had this function it wouldn't matter what browser it is in because ASP is a server-side language. Post this in the JavaScript forum.
Although I'll help you out anyways. Try using -
HTML Code:
<body oncontextmenu="return false;">
or

HTML Code:
<body onclick='return false;' ondblclick='return false;'>
The code above will kill all clicks and the user can simply disable JavaScript to get around this, and people can still just go view->source through their browsers. In the end disabling right click on the whole body is the bad idea. Just on ever object you don't want stolen such as images and text use the second code above so it is harder to steal. The only way to steal it after that is to print the screen, view the source, or turn JavaScript off (once again). There's also some sort of plugin in FF that may be blocking your JavaScript because it disables right clicking.

Last edited by Mattmaul1992 : 01-24-2007 at 09:51 AM.
Mattmaul1992 is offline
Reply With Quote
View Public Profile
 
Old 01-24-2007, 11:07 PM Re: how can i cance mouse click events.
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,025
Name: Forrest Croce
Location: Seattle, WA
Quote:
Originally Posted by Mattmaul1992 View Post
The code above will kill all clicks and the user can simply disable JavaScript to get around this, and people can still just go view->source through their browsers. In the end disabling right click on the whole body is the bad idea. Just on ever object you don't want stolen such as images and text use the second code above so it is harder to steal. The only way to steal it after that is to print the screen, view the source, or turn JavaScript off (once again). There's also some sort of plugin in FF that may be blocking your JavaScript because it disables right clicking.

I'm not sure if the OP is trying to figure out how to kill the context menu, or something else ... but I have to chime in agreement with Mattmaul1992.

As a photographer, whose images have been stolen, cancelling the right-click menu isn't something you want to do. Many use it for navigation - I'm one of them, and if I can't get "back" by right-clicking, I leave the site. Intellectual property isn't something I'm arguing against, but this computer is my physical property, and I don't want it messed with.

A less intrusive method a lot of people use is to cut the images up into a lot of slices, then display them together. This way if someone saves one of your images, they'll only get a small piece of it. Others use a transparant gif file laid over the main image, so you get a single-pixel image if you try saving artwork from a site.

But in the end, whether you use Flash, slicing, java, or anything else, if a visitor can see your site, they can take a picture of their screen with their digital camera. I take basic precautions ( watermark © ), and then spend the rest of my time on the site's content ... at least I can do some good there.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 01-24-2007, 11:33 PM Re: how can i cance mouse click events.
Average Talker

Posts: 28
Name: dinesh s
hi mattmaul,
thanks for ur reply and thanks to forestcroc.

i want to cancel only the middle mouse button click.
what i have to do for that.
dinesh s is offline
Reply With Quote
View Public Profile
 
Old 01-25-2007, 10:02 AM Re: how can i cance mouse click events.
Mattmaul1992's Avatar
Ultra Talker

Posts: 440
Name: Matt
Take a look at http://www.webdevelopersjournal.com/...jsevents3.html
I would tell you flat out but that will also show you some other stuff you can do with JavaScript. I didn't take too long to look at this so if it's not what you want let me know and I'll just write it out for you.
Hope this helps.
But in the end the user CAN print screen and there is no way to get around this (well actually I have heard of a way but I think I remember that it was supposedly quite complex). Usually people want to make it harder for someone to do something to their site that they view harmful, but in this case it is best to just leave it alone unless you want to just keep it simple and use slices.

Last edited by Mattmaul1992 : 01-25-2007 at 06:59 PM.
Mattmaul1992 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how can i cance mouse click events.
 

Thread Tools

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

vB 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.16200 seconds with 13 queries