No Right Click Codes:

The no right click code is an aid in attempting to prevent folks from taking the graphics and source codes on your web site.  It is NOT fool proof, there are ways around it.  I like to think of it as a deterrent.  Just as with any other thing, if someone wants it; they will find a way.  The code is below.

CODE 1

This NO RIGHT CLICK code works ONLY on  images!   Found at Dynamic Drive.

Place this code at the END of your page, just above the </body> tag
 

<script language="JavaScript1.2">

/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="Right click disabled on images!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.layers)
associateimages()
</script> 

CODE 2

Place the code in your HTML between </title> and </head>
 

<script language="JavaScript"> <!-- 
// No rightclick script v.2.5 
// (c) 1998 barts1000 
// barts1000@aol.com 
// Don't delete this header! 
var message="Sorry, that function is disabled. \n\n Contents and Graphics Copyright StarrVisions.com\n\n Please e-mail for source codes, \n\n  Thanks for visiting."; // Message for the alert box 

// Don't edit below! 

function click(e) { 
if (document.all) { 
if (event.button == 2) { 
alert(message); 
return false; 


if (document.layers) { 
if (e.which == 3) { 
alert(message); 
return false; 



if (document.layers) { 
document.captureEvents(Event.MOUSEDOWN); 

document.onmousedown=click; 
// --> </script>


 


MUSIC

This code will make music play in both Netscape and Internet Explorer: 

<BGSOUND SRC="sound name.sound file"><!--For IE--><embed SRC="evennow.mid" HIDDEN="True"><!--for netscape--> 

Just put the name of your sound file in the place where I have show one. 

Also...don't forget to upload the sound file to your file directory! 

To have the music begin as the page is loading; add the following code to
your page...directly after the <body> tags: 

<EMBED SRC="sound name.sound file" Hidden="TRUE" AutoStart="TRUE" Volume="75" Loop="TRUE"><bgsound src="sound name.sound file" Hidden="TRUE" AutoStart="TRUE" Volume="75" Loop="TRUE"> 

OPENING A PAGE IN A NEW WINDOW:

This one is SO easy!  just add the following to your <a href> tag:  target="_blank"   so an example would be as follows: 

<a href="http://www.starrvisions.com/" target="_blank"><img SRC="starr1a.gif" height=36 width=98> 

This is great any time you wish to use it, but especially in frame sets! 

SCROLLING MARQUEE

This is when words scroll from right to left across the page (or left to right or maybe even down!). 
Just remember that the marquee tag does NOT work with Netscape.

<marquee behavior=scroll direction="left">Your message here</marquee>

<marquee behavior=slide direction=left>your message here</marquee>

<marquee behavior="alternate">your message here</marquee>

<marquee behavior="alternate" bgcolor="#color" width="400">your message here</marquee>

If you want it to go in a different direction, just type in "right" instead of "left", or "up" 
and even "down" in your basic marquee code.

You can change the marquee speed,  just need add the scrollamount tag to your marquee tag like this:

<marquee behavior=scroll direction="left" scrollamount="5">Your message here</marquee>

The higher your number, the faster your marquee will scroll.

Add a marquee background:

<marquee bgcolor="#(hex code here)">your message here</marquee>

MOUSEOVER IMAGES

How to make images change on mouseover.
Add this code in between the <head> tag and <title> tag
(this code is for four images, you can alter this code to make more or less images):
 

<script language="JavaScript">
<!-- Hide the script from old browsers --

img0_on = new Image(width,height);
img0_on.src="image2.gif";
img0_off = new Image(width,height);
img0_off.src="image1.gif";
  
img1_on = new Image(width,height);
img1_on.src="image4.gif";
img1_off = new Image(width,height);
img1_off.src="image3.gif";

img2_on = new Image(width,height);
img2_on.src="image6.gif";
img2_off = new Image(width,height);
img2_off.src="image5.gif";
 
img3_on = new Image(width,height);
img3_on.src="image8.gif";
img3_off = new Image(width,height);
img3_off.src="image7.gif"; 

function over_image(parm_name)
    {
        document[parm_name].src = eval(parm_name + "_on.src");
    }
function off_image(parm_name)
    {
        document[parm_name].src = eval(parm_name + "_off.src");
    }
// --End Hiding Here -->
</script>

Image 1 is the image you want showing all the time.
Image 2 is the image you want to show on mouseover. 
Image 3 is permanent.
Image 4 is the mouseover...etc
Remember to substitute your image filename and width and height attributes. 

Next add this code for every mouseover image you insert in your page, this is inserted in the body section of your page:

<a href="yoururl.html" onmouseover="over_image('img0');" onmouseout="off_image('img0')"> <img src="image1.gif" border="0" name="img0"> </a>

Drop-Down Menus

Link Effects

Marquee 1
This is a marquee

Marquee 2
A different marquee

"Fixed" Background

Message Box shows on load

Alert Button

Mail Link

Mail Link & Subject

AIM Link

Embeded Sound

Mouse Over Effects

Make text blink

A Clock Script

Counts how many times a person has returned

Ask for the visitor's name

Password Protection

Block Tripod Pop-up

Simple Table

Make a textarea

Inserting Images

Changing the text font

Turning images into links

Change Scrollbar Colors

Link Styles & Colors

Staus Bar Scroller

I Will add more as I find the time.
Hope some of you found these useful.
Y Starr


Top Of Page

© 2000-2003 StarrVisions - All Rights Reserved
StarrVisions.com