Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2007
    Messaggi
    60

    Suoni hover in javascript

    Salve io ho un problema, ho creato uno script che all'hover su di un link produce un suono (niente di eccezionale) solo che io vorrei che finisse di produrre il suono anche quando levo il mouse da sopra il link, tipo http://www.karimrashid.com/ (lo so che è in flash ma speravo si potesse fare anche in js)

    Il mio codice è:

    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <title></title>  
    <script language="javascript" type="text/javascript">  
    function playSound(soundfile) {  
    document.getElementById("dummy").innerHTML=  
    "<embed src=\""+soundfile+"\" hidden=\"false\" autostart=\"true\" loop=\"false\" />";  
    }  
    </script> 
     <style>  	
    p { 		
    float:left;	 	
    }  
    </style> 
    </head>  
    <body> 
    <span id="dummy"></span>  
    <p onmouseover="playSound('note/x0.au');">[img]images/tasto1.png[/img]</p> 
    <p onmouseover="playSound('note/x1.au');">[img]images/tasto2.png[/img]</p> 
    <p onmouseover="playSound('note/x2.au');">[img]images/tasto3.png[/img]</p> 
    <p onmouseover="playSound('note/x3.au');">[img]images/tasto4.png[/img]</p> 
    <p onmouseover="playSound('note/x4.au');">[img]images/tasto5.png[/img]</p> 
    <p onmouseover="playSound('note/x5.au');">[img]images/tasto6.png[/img]</p> 
    <p onmouseover="playSound('note/x6.au');">[img]images/tasto7.png[/img]</p> 
    <p onmouseover="playSound('note/x7.au');">[img]images/tasto8.png[/img]</p> 
    <p onmouseover="playSound('note/x8.au');">[img]images/tasto9.png[/img]</p> 
    </body> 
    </html>

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Argomento ampiamente trattato fai un ricerca qui sul forum, t'anticipo che l'operazione non è semplicissima.
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.