Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Right click alert



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
LucasZ21
100+ Club


Joined: 26 Feb 2007
Posts: 195
Location: Mansfield, OH

PostPosted: Tue Mar 06, 2007 7:35 pm    Post subject: Right click alert Reply with quote

I'm working on a web site for a photography company....

I want to make it so that when the user views the full size picture from the thumbnail, they can not right click on the image to copy and paste the image.

I need code that will bring up an alert when the user right-clicks on the image.

An example of what i'm talking about is http://www.bullseyetattoos.com - click on any tattoo and try to right click on it. That's what I want to happen.

Can anyone help?
Back to top
View user's profile Send private message Visit poster's website AIM Address
sachav



Joined: 03 Mar 2007
Posts: 32

PostPosted: Tue Mar 06, 2007 11:31 pm    Post subject: Re: Right click alert Reply with quote

Code:
<body onContextMenu="abort();return false">
<script language="JavaScript">
function abort()
{
msg = "YOUR MESSAGE HERE"
alert(msg) // REMOVE THIS LINE TO DISPLAY NO MESSAGE
return
}
</script>
</body>
Back to top
View user's profile Send private message
LucasZ21
100+ Club


Joined: 26 Feb 2007
Posts: 195
Location: Mansfield, OH

PostPosted: Wed Mar 07, 2007 5:49 pm    Post subject: Re: Right click alert Reply with quote

sachav wrote:
Code:
<body onContextMenu="abort();return false">
<script language="JavaScript">
function abort()
{
msg = "YOUR MESSAGE HERE"
alert(msg) // REMOVE THIS LINE TO DISPLAY NO MESSAGE
return
}
</script>
</body>


It doesn't work. Any other ideas?
Back to top
View user's profile Send private message Visit poster's website AIM Address
sachav



Joined: 03 Mar 2007
Posts: 32

PostPosted: Wed Mar 07, 2007 11:38 pm    Post subject: Re: Right click alert Reply with quote

Put it online and/or show me the entire code
Back to top
View user's profile Send private message
LucasZ21
100+ Club


Joined: 26 Feb 2007
Posts: 195
Location: Mansfield, OH

PostPosted: Mon Mar 12, 2007 5:49 pm    Post subject: Re: Right click alert Reply with quote

sachav wrote:
Put it online and/or show me the entire code


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Plymouth vs Shelby</title>

<style type="text/css">
<!--
body,td,th {
   color: #000000;
}
body {
   background-color: #999999;
}
a:link {
   color: #FF0000;
}
a:visited {
   color: #FFFFFF;
}
a:hover {
   color: #FF0000;
}
a:active {
   color: #333333;
}
.style2 {
   font-size: 14px;
   font-style: italic;
   font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style3 {
   font-size: 36px;
   font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style4 {font-size: 14px}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px;}
.style6 {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: x-small;
}
-->
</style></head>

<body>
 

<p align="center" class="style3"><a href="Sabourin_Photography.htm"><img src="Header.gif" alt="Sabourin Photography" name="header" width="504" height="180" border="0" id="header" /></a></p>
<p align="center" class="style2">Girls Basketball vs Shelby </p>
<p align="center" class="style5"><a href="Sabourin_Photography.htm">Home</a> | <a href="stpeters.htm">GBB vs St. Peters </a>| <a href="buckeye.htm">GBB vs Buckeye Central</a> | <a href="mansfieldchristian.htm">GBB vs Mansfield Christian</a></p>
<table width="200" border="5" align="center" cellspacing="5" bordercolor="#666666" bgcolor="#990000" id="vsshelby">
  <tr>
    <td><img src="Thumbnails/DSC_0002_Thumbnail.gif" alt="Click to see full size!" name="shelby1" width="120" height="120" id="shelby1" /></td>
    <td><img src="Thumbnails/DSC_0003_Thumbnail.gif" alt="Click to see full size!" name="shelby2" width="120" height="120" id="shelby2" /></td>
    <td><img src="Thumbnails/DSC_0004_Thumbnail.gif" alt="Click to see full size!" name="shelby3" width="120" height="120" id="shelby3" /></td>
    <td><img src="Thumbnails/DSC_0005_Thumbnail.gif" alt="Click to see full size!" name="shelby4" width="120" height="120" id="shelby4" /></td>
    <td><img src="Thumbnails/DSC_0006_Thumbnail.gif" alt="Click to see full size!" name="shelby5" width="120" height="120" id="shelby5" /></td>
  </tr>
  <tr>
    <td><img src="Thumbnails/DSC_0008_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0009_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0010_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0011_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0012_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
  </tr>
  <tr>
    <td><img src="Thumbnails/DSC_0013_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0014_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0015_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0016_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0017_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
  </tr>
  <tr>
    <td><img src="Thumbnails/DSC_0018_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0019_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0020_Thumbnails.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center"><span class="style5"><a href="order.htm">Order a Picture</a></span> </p>
<p align="center" class="style4"><span class="style6">All pictures are copyrighted | &copy; 2007 Tom Sabourin | <a href="mailto:baseball_man0@yahoo.com">Contact us</a></span></p>
</body>
</html>


I took out the code that you gave me so you could see what I was working with before...

sorry if it took awhile, I just got back to class
Back to top
View user's profile Send private message Visit poster's website AIM Address
sachav



Joined: 03 Mar 2007
Posts: 32

PostPosted: Tue Mar 13, 2007 12:40 am    Post subject: Re: Right click alert Reply with quote

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Plymouth vs Shelby</title>

<style type="text/css">
<!--
body,td,th {
   color: #000000;
}
body {
   background-color: #999999;
}
a:link {
   color: #FF0000;
}
a:visited {
   color: #FFFFFF;
}
a:hover {
   color: #FF0000;
}
a:active {
   color: #333333;
}
.style2 {
   font-size: 14px;
   font-style: italic;
   font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style3 {
   font-size: 36px;
   font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style4 {font-size: 14px}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px;}
.style6 {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: x-small;
}
-->
</style></head>
<script language="javascript">
msg = "Right click disabled!"
displaymsg = true // PUT displaymsg = false IF YOU WANT TO DISPLAY NO MESSAGE
var rightclick = new Object
rightclick.abort = function() { if(displaymsg==true) { alert(msg); return(false) } else { return(false) } }
</script>
<body onContextMenu="return rightclick.abort();">
 

<p align="center" class="style3"><a href="Sabourin_Photography.htm"><img src="Header.gif" alt="Sabourin Photography" name="header" width="504" height="180" border="0" id="header" /></a></p>
<p align="center" class="style2">Girls Basketball vs Shelby </p>
<p align="center" class="style5"><a href="Sabourin_Photography.htm">Home</a> | <a href="stpeters.htm">GBB vs St. Peters </a>| <a href="buckeye.htm">GBB vs Buckeye Central</a> | <a href="mansfieldchristian.htm">GBB vs Mansfield Christian</a></p>
<table width="200" border="5" align="center" cellspacing="5" bordercolor="#666666" bgcolor="#990000" id="vsshelby">
  <tr>
    <td><img src="Thumbnails/DSC_0002_Thumbnail.gif" alt="Click to see full size!" name="shelby1" width="120" height="120" id="shelby1" /></td>
    <td><img src="Thumbnails/DSC_0003_Thumbnail.gif" alt="Click to see full size!" name="shelby2" width="120" height="120" id="shelby2" /></td>
    <td><img src="Thumbnails/DSC_0004_Thumbnail.gif" alt="Click to see full size!" name="shelby3" width="120" height="120" id="shelby3" /></td>
    <td><img src="Thumbnails/DSC_0005_Thumbnail.gif" alt="Click to see full size!" name="shelby4" width="120" height="120" id="shelby4" /></td>
    <td><img src="Thumbnails/DSC_0006_Thumbnail.gif" alt="Click to see full size!" name="shelby5" width="120" height="120" id="shelby5" /></td>
  </tr>
  <tr>
    <td><img src="Thumbnails/DSC_0008_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0009_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0010_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0011_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0012_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
  </tr>
  <tr>
    <td><img src="Thumbnails/DSC_0013_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0014_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0015_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0016_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0017_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
  </tr>
  <tr>
    <td><img src="Thumbnails/DSC_0018_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0019_Thumbnail.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td><img src="Thumbnails/DSC_0020_Thumbnails.gif" alt="Click to see full size!" width="120" height="120" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">&nbsp;</p>
<p align="center"><span class="style5"><a href="order.htm">Order a Picture</a></span> </p>
<p align="center" class="style4"><span class="style6">All pictures are copyrighted | &copy; 2007 Tom Sabourin | <a href="mailto:baseball_man0@yahoo.com">Contact us</a></span></p>
</body>
</html>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap