Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  agyat : (23 May 2013 - 01:23 AM) Wow! Mr. Sb Back Home.
@  OpaQue : (23 May 2013 - 12:44 AM) Ting
@  OpaQue : (24 April 2013 - 02:44 PM) I guess, Time to run Mycent script.
@  OpaQue : (24 April 2013 - 02:43 PM) wow.. not much spam. except habatt posting lot of links.. :P
@  yordan : (23 April 2013 - 01:04 PM) You're welcome, agyat. Nice to have been helpful. Second lesson: try full words, "you" instead of "EW".
@  agyat : (23 April 2013 - 05:03 AM) @YORDAN: tHANK EW FOR YOUR FIRST LESSON.   :D
@  yordan : (22 April 2013 - 09:43 PM) @agyat : "why don't you help me", or "please help me", or "please teach us"
@  yordan : (22 April 2013 - 09:42 PM) welcome back, velma
@  velma : (22 April 2013 - 07:51 AM) **yawns** Good to be back, wonder what is going on here :)
@  agyat : (22 April 2013 - 03:50 AM) Oh! so, why don't help me learn english..
@  yordan : (21 April 2013 - 08:38 PM) The goal mentioned by shiu : "learning english, learning computer"
@  agyat : (21 April 2013 - 06:31 PM) WHAT GOAL?
@  yordan : (20 April 2013 - 10:39 AM) yes, that's our goal. simultaneouly learning English and teaching/learning computer using.
@  shiyu : (20 April 2013 - 07:30 AM) learning english,learning computer
@  yordan : (19 April 2013 - 01:11 PM) Oh, I see, it's just a trick in order to force people looking at your texte. Somehow smart, maybe.
@  agyat : (19 April 2013 - 02:54 AM) And of course I know it is not SEO friendly.
@  agyat : (19 April 2013 - 02:52 AM) There may be two possible answers for that ....


1) Shout was posted using mobile keypad.

2) To force people read content carefully and/or with more concentration.
@  agyat : (19 April 2013 - 02:49 AM) There may be two possible answers for that ....
@  yordan : (18 April 2013 - 09:35 PM) however, why this mixing of capital letters in the middle of your text?
@  agyat : (18 April 2013 - 11:10 AM) false feelings.

Replying to Javascript: Disable Mouse Right-click In Browser


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

FirefoxRocks

Posted 06 February 2010 - 06:58 AM

The smallest piece of code is the oncontextmenu="return false;" thing, which you can really use if you want to.

But there is no point in disabling right click because there are many ways to view the HTML, CSS and images of your have if they really want. View source, save page, use the W3C validator, there are many ways.
To really disable right click, you can design your entire website in Flash, but that is likely overkill. And I can still take a picture by pressing Print Screen.

Posted 30 January 2010 - 12:18 PM

How i dosable right click on fireFox browserJavascript: Disable Mouse Right-click In Browser

Hi

I want to disable right click on my photo gellary. Your script work in IE perfectly but doesn't Firefox. Please help me

-reply by chrome

 


Brutal Art

Posted 12 January 2010 - 04:12 AM

Hi , kinda new so if you don't understand i don't blame you ;)

I' have been reading you comments and as such i know i think heres what i got

Paste this under your <body> Im your html code

[codebox]<div style="margin:auto; width:100%;">
<script src="Enter your file location here" type="text/javascript"></script>
<div class="topbg">[/codebox]


Now for the main code with you save as what ever name you want as long as it is .js (Javascript)



[codebox]var message="Function Disabled"; //edit this message to say what you want



function clickIE()
{
if (event.button==0) {alert(message); return false;}
}
function clickNS(e)
{
if (document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3)
{
alert(message);return false;
}
}
}

if(window.navigator.appName=="Netscape")
{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
document.oncontextmenu=new Function("return false")
}
else if (window.navigator.appName=="Microsoft Internet Explorer")
{
document.oncontextmenu=clickIE;
}
else if (window.navigator.appName=="Opera")
{

}
else if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
}
else
{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}

//[/codebox]

Then save it as your selected location then you can right click on your web site ;)

Posted 29 December 2009 - 06:54 AM

Thanks TavoxPeru --- It is Really helpful Javascript: Disable Mouse Right-click In Browser

I was having problem of disabling right click while doing multibrowser compatibility.But the solution provided by "TavoxPeru" it very helpful for me and get my job done.

Thanks Again

-reply by Ashwini

Posted 17 January 2009 - 09:19 PM

easy stop right click - right click browser backJavascript: Disable Mouse Right-click In Browser

add this to the body tag: oncontextmenu="window.History.Go(-1);return false"

The user is sent back a page whenever they right click on your page.Though its tempting to replace the window.History with window.Close, it will cause a popup in IE.


TavoxPeru

Posted 08 March 2008 - 06:43 AM

Another way for disabling the mouse right-click is by using the oncontextmenu event, if you add this javascript code:
<body oncontextmenu="return false">
to the body tag, you disable the context menu that appears whenever you right click in your page.

For protect your images you can use another image that covers the one you want to protect or a div that covers all your page (located in front of your page) like:
<div style="width:100%;margin:0px auto;z-index:10;top:0px;left:0px;background-color:transparent;height:100%"><img alt="image alt text" src="imagename" ></div>
And of course, you can use the imagetoolbar meta tag, this one will not protect your images, it simply disallow the image toolbar of Internet Explorer and Firefox:
<meta http-equiv="imagetoolbar" content="no">
Best regards,

KDEWolf

Posted 07 March 2008 - 10:57 PM

Don't forget about the PrintScreen button on your keyboard.
Disabling right-click could be useful, but it won't protect your images.
Put in a water-mark and maybe decrease the resolution to a preview edition to protect your images.

Yes that's the way to go to protect images. But nowadays you've got to put the watermark in the very middle of the picture, since it's very common to have people cropping the original picture to remove watermarks from the borders and alike.
A clear example of it is the watermark option in DeviantArt. It's huge, it's very noticeable and right in the image center. It's actually awful to look at that, since it kind of screws the picture mood, but in the case of having constant problems, it's the only way to go.

jc804

Posted 07 March 2008 - 09:29 PM

Don't forget about the PrintScreen button on your keyboard.
Disabling right-click could be useful, but it won't protect your images.
Put in a water-mark and maybe decrease the resolution to a preview edition to protect your images.

KDEWolf

Posted 07 March 2008 - 07:50 AM

This is not only an annoying measure, it also cripples deeply usability. Not to say that nowadays with the steady growth of alternate browsers, mostly Firefox, Safari and Opera, it simply won't work. It's VERY hard to "hide" things like HTML/CSS/JS code from a curious or bad intentioned reasonably intelligent person.
I'd say this one is a big no-no.

TavoxPeru

Posted 05 March 2008 - 07:46 AM

How to desable right click while opening new window?

java script: Disable Mouse Right-click In Browser
Hi,
I know how to desable right click in winow but I am unable to desable right click in new window.When ido I click on link and open a new window.
Pls reply..
Please do the needful.
-Amit Tiwari

I don't understand completely but in case the new window is yours then you must copy the code to it also, by yours i mean that you are the owner -the one who makes the page- of the opener and of the new window.

And, i don't know if it works with Safari because i don't use it.

Best regards,

Review the complete topic (launches new window)