Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-27-2006, 10:19 PM   PM User | #1
derek barnstorm
New to the CF scene

 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
derek barnstorm is an unknown quantity at this point
Image flip with sound

I am using the follwing script for an image flip, but I want to add a different sound effect to each link with onMouseOver. Does anybody know how to convert the script to play sounds or is there a better way to do it? Also, is it possable to get sound working with OnMouseOver in FireFox and Netscape aswell as exploror.

Many thanks,

Des.

The script:

<head>
<script>
{
home=new Image();
home.src="home.gif";
home_over=new Image();
home_over.src="home_over.gif";

photos=new Image();
photos.src="photos.gif";
photos_over=new Image();
photos_over.src="photos_over.gif";


}

function imageChange(imageID,imageName)
{
document.images[imageID].src=eval(imageName+".src");
}
</head>
</script>

<body>

<a href="home.html" onMouseOver="imageChange('home','home_over')" onMouseOut="imageChange('home','home')"><img src="images/buttons/home.gif" alt="Home" border=0 name="home"></a>
<a href="photos.html" onMouseOver="imageChange('photos','photos_over')" onMouseOut="imageChange('photos','photos')"><img src="images/buttons/photos.gif" alt="Photos" border=0 name="photos"></a>

</body>
derek barnstorm is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:59 PM.


Advertisement
Log in to turn off these ads.