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 01-06-2012, 07:52 PM   PM User | #1
XENTIYON
New to the CF scene

 
Join Date: Jan 2012
Location: The Netherlands
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
XENTIYON is an unknown quantity at this point
HTML5 Mouseover/Click sound effect

Hi people !
I went to this page:

http://www.javascriptkit.com/script/....shtml#current

and I applied that script to my website, everything work perfectly.
I only have a question about it:

* What should I add to the code to avoid the sound activate even when I'm hovering over the margin of the image?

* Would it be possible that the sound activate only when the mouse is hovered over the image and not the margin as well ?

* Is the only solution; to insert every image in their own div and then letting the div handle the margin?

this is the site www.blackbandanamovement.com
the images I'm talking about are in the footer.
thanks in advance
XENTIYON is offline   Reply With Quote
Old 01-07-2012, 03:35 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,375
Thanks: 18
Thanked 349 Times in 348 Posts
sunfighter is on a distinguished road
On line 160
Code:
<img id="img1" alt="DOWNLOAD IT NOW !!" height="40" onmousedown="clicksound.playclip(); FP_swapImg(1,0,/*id*/'img1',/*url*/'button97.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button95.jpg')" onmouseover="mouseoversound.playclip(); FP_swapImg(1,0,/*id*/'img1',/*url*/'button96.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button96.jpg')" src="button95.jpg" style="border: 0" width="200" /><!-- MSComment="ibutton" fp-style="fp-btn: Glass Capsule 4; fp-font: Square721 BT; fp-font-style: Bold; fp-font-size: 12; fp-font-color-hover: #C0C0C0; fp-font-color-press: #FFFFFF; fp-bgcolor: #333333" fp-title="DOWNLOAD IT NOW !!" --></a></div>
Remove
Code:
onmouseover="mouseoversound.playclip();
And to get rid of that jump out of your skin when clicked sound remove
Code:
onmousedown="clicksound.playclip();
sunfighter is offline   Reply With Quote
Old 03-20-2012, 10:05 AM   PM User | #3
David.P
New to the CF scene

 
Join Date: Mar 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
David.P is an unknown quantity at this point
Hover Sound Javascript example (navigation error)

Hi guys & forum,

I also have a question regarding the sound hover example at
http://www.javascriptkit.com/script/...oundlink.shtml

I think that there is a small error on that page: If you open the page, then CLICK on any of the hover sound links, and then hit the back button in your browser (actually only in Opera), the hover sound file is played once again (on going back to said page).

I'd be more than happy if somebody could point me to a way how to avoid this additional playing of the hover sound file on hitting the "back" button of the browser.

Thanks heaps already,
David.P

Last edited by David.P; 03-20-2012 at 10:21 AM..
David.P 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 05:06 PM.


Advertisement
Log in to turn off these ads.