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 Evertjan. on 03/19/06 13:14

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>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

 

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

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