I have javascript code is entered to the blog, but not the RUN. why?
This is a discussion on Play Sound on Mouseover or MouseClick within the Programming forums, part of the Web Designing & Development category; [FONT=Arial, Helvetica, sans-serif][SIZE=2]There are 2 ways to play sound on mouseover. This first way seems to be more reliable than ...
[FONT=Arial, Helvetica, sans-serif][SIZE=2]There are 2 ways to play sound on mouseover. This first way seems to be more reliable than the javascript version
This is a great javascript which allows you to play different sounds as your visitors runs their mouse over each link or music on mouseover of an image.
[/SIZE][/FONT][FONT=Arial, Helvetica, sans-serif][SIZE=2]STEP 1[/SIZE][/FONT]
please post that code into body part of the web page...
[FONT=Arial, Helvetica, sans-serif][SIZE=2]STEP 2[/SIZE][/FONT]Code:<!-- --><bgsound id="soundfiles"> <script language="JavaScript"><!-- // Sound on Mouseover javascript supplied by http://www.hypergurl.com var aySound = new Array(); // PLACE YOUR SOUND FILES BELOW aySound[0] = "CHORD.wav"; aySound[1] = "DING.wav"; aySound[2] = "CHORD.wav"; // Don't alter anything below this line IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0; NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0; ver4 = IE||NS? 1:0; onload=auPreload; function auPreload() { if (!ver4) return; if (NS) auEmb = new Layer(0,window); else { Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>"; document.body.insertAdjacentHTML("BeforeEnd",Str); } var Str = ''; for (i=0;i<aySound.length;i++) Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>" if (IE) auEmb.innerHTML = Str; else { auEmb.document.open(); auEmb.document.write(Str); auEmb.document.close(); } auCon = IE? document.all.soundfiles:auEmb; auCon.control = auCtrl; } function auCtrl(whSound,play) { if (IE) this.src = play? aySound[whSound]:''; else eval("this.document.embeds[whSound]." + (play? "play()":"stop()")) } function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); } function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); } //--></script> <!-- -->
[FONT=Arial, Helvetica, sans-serif][SIZE=2]Simply add this code into each link, changing the number of the mouseover event to correspond to your sound file.[/SIZE][/FONT]
[FONT=Arial, Helvetica, sans-serif][SIZE=2]onMouseOver="playSound(0)" onMouseOut="stopSound(0)"[/SIZE][/FONT]
[FONT=Arial, Helvetica, sans-serif][SIZE=2]Your link code should look like this;
<a href="http://www.yourlink.com" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">YOUR LINK</a>[/SIZE][/FONT]
I have javascript code is entered to the blog, but not the RUN. why?
Hey Thanks for sharing such a useful post and you know i am just searching for this comment because i have to use it in my project.... all the information you share just so helpful to me... all that javascript coding i need it...
Thank you for sharing sound javascript on mouseover. It's worked for me....
Thank you very for sharing your knowledge,it is a very useful tool,I definitely use this concept.
Bookmarks