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


for some reason this rollover code isn't working. NEED HELP!



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
akbrody



Joined: 15 Apr 2008
Posts: 1

PostPosted: Tue Apr 15, 2008 9:26 pm    Post subject: for some reason this rollover code isn't working. NEED HELP! Reply with quote

<!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=utf-8" />
<title>RolloverExample</title>
<script language="javascript" type="text/javascript">
window.onload = RolloverInit()

function RolloverInit(){
for (var i=0; i<document.images.length; i++){
if (document.images[i].parentNode.tagName == "A"){
setupRollover(document.images[i])
}
}
}

function setupRollover(thisImage){
thisImage.outImage=new Image();
thisImage.outImage.src = thisImage.src;
thisImage.onmouseout = rollOut;

thisImage.overImage= new Image();
thisImage.overImage.src = "images/"+thisImage.id+"_on.gif";
thisImage.onmouseover = rollOver;
}

function rollOver(){
this.src=this.overImage.src;
}

function rollOut(){
this.src=this.outImage.src;
}


</script>
</head>
<body>

<a href="http://www.yahoo.com/"><img src="images/button1_off.gif" border="0" alt="button1" id="button1" /> </a> &nbsp;&nbsp;
<a href="http://www.google.com/"><img src="images/button1_off.gif" border="0" alt="button2" id="button2" /> </a>


</body>



</html>
Back to top
View user's profile Send private message
nin2010



Joined: 20 Apr 2008
Posts: 3

PostPosted: Sun Apr 20, 2008 4:01 pm    Post subject: Re: for some reason this rollover code isn't working. NEED HELP! Reply with quote

Heya,

I used the tutorial on this website to create javascript rollover images. It was pretty straight forward to follow. You can post in this thread if your having problems figuring it out.


http://www.yourhtmlsource.com/images/rollovers.html
Back to top
View user's profile Send private message MSN Messenger
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