Ive got mouse over and mouse click sounds playing using embeded sound objects and adding onclick="document.all.snd_object.play()" as a property of each <a> ref. But this is all way too cumbersome.
There has got to be a way to have all my body elements embed the sounds and all my <a> refs call the appropriate onclick, onmouseover, and onmouseout events using a style sheet.
What I want is to have this all setup via my css file so that my entire website plays mouse over and mouse click when the user clicks on links.
Is this possible?you probably would need to use javascript with this.
something like:
function correctTags(){
var aTags = document.getTagsByName('a');
for(var i=0; i<aTags.length; i++){
aTags.onclick= "document.all.snd_object.play()";
aTags.onmouseover = "document.all.snd_objectMouseOver.play()";
aTags.onmouseout = "document.all.snd_objectMouseOut.play()";
}
}
Call this function in the onload event of the bodyI haven't tried it yet but have you looked into using the A:HOVER command from CSS? That might be something you could play around with and see if it works.
There has got to be a way to have all my body elements embed the sounds and all my <a> refs call the appropriate onclick, onmouseover, and onmouseout events using a style sheet.
What I want is to have this all setup via my css file so that my entire website plays mouse over and mouse click when the user clicks on links.
Is this possible?you probably would need to use javascript with this.
something like:
function correctTags(){
var aTags = document.getTagsByName('a');
for(var i=0; i<aTags.length; i++){
aTags.onclick= "document.all.snd_object.play()";
aTags.onmouseover = "document.all.snd_objectMouseOver.play()";
aTags.onmouseout = "document.all.snd_objectMouseOut.play()";
}
}
Call this function in the onload event of the bodyI haven't tried it yet but have you looked into using the A:HOVER command from CSS? That might be something you could play around with and see if it works.