Miz_Renegade
12-24-2002, 05:20 PM
Is there such a script that for buttons, when you click them they change instead of mouse over?? If there is, can you do sounds with the pictures??:confused:
|
Click to See Complete Forum and Search --> : Help, Please Miz_Renegade 12-24-2002, 05:20 PM Is there such a script that for buttons, when you click them they change instead of mouse over?? If there is, can you do sounds with the pictures??:confused: pyro 12-24-2002, 06:12 PM Use onClick instead of onMouseOver, and yes, you can use sounds with your pictures. Miz_Renegade 12-30-2002, 12:08 PM ok, but can you use both onmouseover and onclick on the same image? khalidali63 12-30-2002, 12:12 PM Of course you can, I am sure you do not want to make 1 reaction happened twice on both events though...:-) cheers Khalid Miz_Renegade 12-30-2002, 12:16 PM cool. Now how do I put the sound in...same as with the pic? khalidali63 12-30-2002, 12:33 PM Take look at this tutorial http://www.webreference.com/js/column20/ Khalid Miz_Renegade 12-30-2002, 01:02 PM ok, one more question. to add it in, what do I put instead of "onclick"=movepic or does it stay the same? khalidali63 12-30-2002, 01:08 PM I am sorry, you lost me there,can you pls elaborate a bit more? Miz_Renegade 12-30-2002, 01:11 PM I put this for the picture: onclick="movepic('name','url') but what do I put for the sound? khalidali63 12-30-2002, 01:27 PM that is totaly upto you,you can use the same function to play the music or a different one. You can actually call multiple functions from one event separated by semicolon";" below is a code snippet that will sound file (wav,au and midi formats are allowed) <div id="soundBlock" style="position:absolute;"></div> <form> <input type="Button" onclick="playSound();" value="onclick = Play Sound"></input> </form> <script language="JavaScript1.2"> function playSound(){ obj = document.getElementById("soundBlock"); obj.innerHTML = "<EMBED SRC=\"testme.wav\" HIDDEN=\"true\" AUTOSTART=\"true\" STARTTIME=\"00:10\" ENDTIME=\"00:30\">"; } </script> Miz_Renegade 12-30-2002, 01:40 PM thanks! does anything go in the parenthesis next to playsound()? khalidali63 12-30-2002, 01:51 PM not in this case,on the other hand if you want to pass a parameter i.e url to a specific sound file when clicked on a specific button, in that case a parameter may be needed Khalid Miz_Renegade 12-30-2002, 10:41 PM Hmmm, I am having problems. I want to use the onclick=movepic('name','url') thing(I've already made fancy button :P), but I don't know how to work it. I want it so that when you click the picture(in this case, my fancy button :P) it makes the preferred sound. I've tried different things but have failed...maybe you could help with that? By the way, thanks for all your efforts in helping me, it is very much appreciated!! (edit: Stupid typos >:F ) khalidali63 12-30-2002, 10:57 PM Instead of this line in your code onclick=movepic('name','url') paste the line below onclick="movepic('name','url');playMusic();" I am hoping the code I sent you earlier is in between the <script></script> tags.. It should work Khalid webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |