You are here: Re: Play a sound when clicking a hyperlink? « HTML « IT news, forums, messages
Re: Play a sound when clicking a hyperlink?

Posted by Jonathan N. Little on 03/19/06 16:18

Evertjan. wrote:

> Chris Ianson wrote on 19 mrt 2006 in comp.lang.javascript:
>
>
>><Jacob.Lyles@gmail.com> wrote in message
>>news:1142738345.734005.8560@g10g2000cwb.googlegroups.com...
>>
>>>Hello,
>>>
>>>I don't know what I'm talking about, but might wrapping some text
>>>with nested links work, one for the web page and one for the sound?
>>>Lacking that, you could use a Javascript onClick() event handler to
>>>redirect them after clicking the link, but you'd be dependent on them
>>>having Jscript turned on (which 95% of people do anyway).
>>
>>Thanks for a sensible reply to my question which was 'how to' do it
>>(not 'should I' and 'please give your opinion on if it's a bad idea').
>
>
> it seems a bad idea
>
>
>>Can you give an example of such code that will call a URL hyperlink
>>and play a sound when clicked please.
>>
>>Cheers!
>>
>>
>
>
> <bgsound src="silend.mid" id="song">
>
> <a href="http://cnn.com/" onclick="return soundlink(this);">
> Play Clip</a>
>
> <script >
> var where;
> function soundlink(x){
> where=x;
> document.getElementById('song').src='3secSound.mid';
> setTimeout('location.href=where.href',3000);
> return false;
> }
> </script>
>
>
I like that idea 'cuz it will NOT work in my browser! You will only
annoy IE users. I also recall your cannot script it to turn on or off
the sound like Netscape's attempt at this with EMBED, it is background
sound *only* where you can control the looping and initial delay in
playing when the pages loads. Also your document will not validate with
BGSOUND element it was never part of HTML.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация