html - JavaScript event parameter in Firefox -
i have code:
function buttonhighlight(event, img, name) { if (img === null) { img = event.target; } img.src = "img/" + name + "_on.png"; img.style.cursor = "pointer"; } function buttonlosthighlight(event, img, name) { if (img === null) { img = event.target; } img.src = "img/" + name + "_off.png"; img.style.cursor = "auto"; }
<button type="submit" form="login_form" id="log_window_b" class="fake_button" onclick="loginhandler()"> <img src="img/send_off.png" alt="invia" width="55" height="15" onmouseover="buttonhighlight(event, null, 'send')" onmouseout="buttonlosthighlight(event, null, 'send')"> </button>
if try without event parameter in js function , in html event attribute, works fine in chrome, not in firefox. if use code in firefox doesn't work, works if "event" attribute in function, need other attributes!
is absolute requirement achieve in pure javascript ?
seeing code, done in css.
Comments
Post a Comment