the below code is working, i just need help with the music. when the button is clicked, i want it to play loop.mp3 and when it is clicked again I want it to stop. personally, i always have trouble with embedding sound with javascript, especially adding it to other functions going on. sorry for the newbie question, but thanks in advance.
Code:<script language="javascript"> function toggle() { var ele = document.getElementById("toggleText"); var text = document.getElementById("displayText"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerHTML = "<img src='paused.gif' border='0'>"; } else { ele.style.display = "block"; text.innerHTML = "<img src='system/playing.gif' border='0'>"; } } </script> <a id="displayText" href="javascript:toggle();"><img src="paused.gif" border='0'></a> <div id="toggleText" style="display: none"><h1>sound should play now</h1></div>



Reply With Quote

Bookmarks