Jump to content



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

Deactivate right click


43 replies to this topic

#1 djleli

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 24 posts

Posted 09 August 2004 - 09:49 PM

<style onload="function noRightClick() {if(event.button==2) [br]{alert('Copyright® by Bullit')}}document.onmousedown=noRightClick"> </style>
[/br]
OR
[br]
<noscript>You need to have JavaScript enabled in order to view this page correctly!</noscript> [/br]<script type="text/javascript"><!-- [br]var message="don't do that"; [/br]function clickIE4(){ [br]if (event.button==2){ [/br]alert(message); [br]return false; [/br]} [br]} [/br]function clickNS4(e){ [br]if (document.layers||document.getElementById&&!document.all){ [/br]if (e.which==2||e.which==3){ [br]alert(message); [br]return false; [/br]} [br]} [/br]} [/br]if (document.layers){ [br]document.captureEvents(Event.MOUSEDOWN); [/br]document.onmousedown=clickNS4; [br]} [/br]else if (document.all&&!document.getElementById){ [br]document.onmousedown=clickIE4; [br]} [/br]document.oncontextmenu=new Function("alert(message);return false") [/br]//--></script>


#2 chinfo

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 119 posts

Posted 10 August 2004 - 01:51 AM

That script, or more specifically the behavior it supports, its useless as there a lot of ways to get around the no right button trick. Copyright concerns are legitimate, but it also annoys visitors if you try to control any of the functionality inherent to their end.

#3 djleli

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 24 posts

Posted 10 August 2004 - 11:11 AM

yeah a lot of ppl know that you can go around this by viewing sources or other ways but there are many ppl that never knew about this and so they will be cot in it. ALso it makes te site a bit more pro

#4 ICE-XG

    Premium Member

  • Kontributors
  • PipPipPipPipPipPipPipPip
  • 195 posts
  • Location:Texas

Posted 22 August 2004 - 08:09 PM

that's kool. Thanks 4 ur help.

#5 zip_mc

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 316 posts
  • Location:Australia
  • Interests:GFX

Posted 23 August 2004 - 05:49 AM

i use to think it looked pro but now i think its more a tackie affect... for some reason effects like that and things like stuff chasing you cursor i really dont like... just gets in the way when i'm reading somthing on the page...

#6 Zenchi

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 498 posts

Posted 23 August 2004 - 05:55 AM

Two ways I can think of gettings around this off the top of my head:

Highlight + Ctrl & C

View Source


Sheesh, when I did this one day in class, it amazed my Science Teacher.

How sad, eh?

Although, I've never seen that <style> script before, I'm going to go do a search on it. :D

#7 hasa

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 13 posts

Posted 25 August 2004 - 07:56 AM

The best right click protection what I find on Internet are:
oncontextmenu="return false" ondragstart="return false" onselectstart="return false"

Put this code direct in body element.
For example:
<body topmargin="0" leftmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">

</body>


hasa :D
_ _ _ _ _ _ _ _ _ _ _ _
The only true success is when you live fife your own way

#8 CorpseGrinder

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 75 posts

Posted 14 September 2004 - 07:47 AM

i think disableing right clicking is a good way to protect some of your creations from being stolen from newbies that right click "save target/picture as heh"

#9 Kovi

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 21 posts

Posted 15 September 2004 - 07:59 PM

But it's also completely useless and will also annoy your users. I reccommend against using anything to disable rightclicking, since it's so easy to get around them. And, yes, even newbies can figure them out. Screenshotting, anyone?

Also, you're disabling several helpful, legit uses for rightclicking, such as 'copy link location' and 'open in a new window/tab'. Or rightclicking and selecting 'add to favorites/bookmarks', which surely is something that you would want your users to do, heh.

#10 nbop

    Newbie

  • Kontributors
  • Pip
  • 5 posts

Posted 17 September 2004 - 06:13 PM

<body topmargin="0" leftmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
as hasa said is indeed the best. It blocks right clicking and dragging so no ctrl+C. But if you really want the source safe you should best open in a new window where you dont allow the toolbars, and even better is using frames. Ok you think frames? easy to find the page, view -> source and you can see all the urls of each frame... BUT haha,
<script language="javascript">[/br]if (top.document==self.document)[br]window.location.href='index.html'[/br]</script>
[br]
index.html must be the site with the frames (you can shame into for ex frames.htm or whatever) The last code makes that the page can't be viewed except in the frames! See you stupid newbie copiers. But I know a way to get the source :P ...




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users