Combinar onmouseover con funcion de voz
Publicado por Leonel Prior (1 intervención) el 25/06/2014 18:42:26
Hola muy buenos dias, necesito su ayuda, estoy empezando con HTML y tengo como idea poner con la accion onmouseover y la funcion de voz dar un mensaje al momento de dar pasar el mouse sobre la imagen, como puedo combinar estas dos opciones, muchas gracias por ayuda, les dejo mi codigo para que me puedan ir guiando
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<script>
function bigImg(x)
{
x.style.height="64px";
x.style.width="64px";
}
function normalImg(x)
{
x.style.height="32px";
x.style.width="32px";
}
texto = [ 'Prueba de voz' , 'LIO PRIOR' ]
var msg = new SpeechSynthesisUtterance();
msg.voiceURI = 'native';
msg.volume = 1;
msg.rate = 1;
msg.pitch = 2;
msg.text = texto[1];
msg.lang = '';
msg.onended = function(e){
console.log( 'Finished in' + event.elapsedTime + 'seconds' );
};
speechSynthesis.speak(msg);
</script>
<script src="voz.js"></script>
</head>
<body>
<img onmouseover="bigImg(this)" onmouseout="normalImg(this)" border="0" src="balon.jpg" alt="futbol" width="32" height="32">
</body>
</html>
Valora esta pregunta


0