Important alert: (current site time 7/15/2013 1:00:21 PM EDT)
 

VB icon

a rollover script

Email
Submitted on: 9/5/1999
By: Ben Doherty  
Level: Not Given
User Rating: By 2 Users
Compatibility: JavaScript
Views: 22994
 
     Create javascript rollover effects without having a less advanced browser popup error messages.
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :a rollover script
'**************************************
<a href="whatever.html" onMouseover="imgOn('img1')"
 onMouseout="imgOff('img1')"><img src="whatever.gif" width="127" height="74" alt="Pictures"
 border="0" name="img1"></a>
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: a rollover script
' Description:Create javascript rollover effects without having a less advanced browser popup error messages.
' By: Ben Doherty
'
' Assumes:you need to have an off image (image displayed when mouse isn't over the image) and an on image (image displayed when mouse is over the link) (sorry for the add) for an example go to http://www.mindspring.com/~jake-d/nwbands/ or http://v-basic.virtualave.net and look at the source for another example of how to do this.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=1673&lngWId=14'for details.'**************************************

<script language="javascript">
<!--
 bName = navigator.appName;
 bVer = parseInt(navigator.appVersion);
if ((bName == "Netscape" && bVer >= 3) ||
 (bName == "Microsoft Internet Explorer" && bVer >= 4)) br = "n3";
 else br = "n2";
if (br == "n3") {
img1on = new Image(); 
img1on.src = "whateveron.gif"; 
 
img1off = new Image(); 
img1off.src = "whateveroff.gif"; 
}
// Function to 'activate' images.
function imgOn(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "on.src");
}
}
// Function to 'deactivate' images.
function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");
}
}
// -->
</script>


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.