<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Helo Del,<BR>
this code works as expected on both, IE and FX (strictmode): <BR>
<BR>
<a href="#" onMouseOver = toggle_visibility('hint4')><BR><img src="../../image/icon_toggle.jpg" width="22" height="22" border="0"></a><BR>
<span class = "hidden_hint" id=hint4><BR> Add -<BR> <img src="../images/sq_root_7.gif" align="absmiddle"><BR> to both sidesof the equation.<BR></span><BR>
<BR>
function toggle_visibility(id) {<BR> var e = document.getElementById(id);<BR>
if(e.style.visibility != 'visible')<BR> e.style.visibility = 'visible';<BR> else<BR> e.style.visibility = 'hidden'; <BR>} <BR>
<BR>
One thing I don't understand is what's the use of a toggle function if<BR>
there is no "onmouseout" event defined? Since you'll have to mouseover<BR>
twice to toggle it, consider defining the mouseout also:<BR><BR>
<a href="#"onMouseOver = toggle_visibility('hint4') <BR>
onMouseOut = toggle_visibility('hint4')><BR>
...<BR><BR>
Regards<BR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <BR> Troy III <BR> progressive art enterprise<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR><BR><BR><BR>
<HR id=stopSpelling>
<BR>
> From: del@delweg.com<BR>> To: javascript@LaTech.edu<BR>> Date: Mon, 4 Jun 2007 22:13:51 -0500<BR>> Subject: [Javascript] Trouble with id<BR>> <BR>> Good Day;<BR>> <BR>> This is the JavaScript function<BR>> function toggle_visibility(id)<BR>> {<BR>> var e = document.getElementById(id);<BR>> if(e.style.visibility != 'visible')<BR>> e.style.visibility = 'visible';<BR>> else<BR>> e.style.visibility = 'hidden';<BR>> }<BR>> <BR>> This is the HTML which does the calling<BR>> <a href="#" onMouseOver = toggle_visibility(104)><BR>> <img src="../../image/icon_toggle.jpg" width="22" height="22" <BR>> border="0"></a><BR>> <span class = "hidden_hint" id=104><BR>> Add -<img src="../images/sq_root_7.gif" align="absmiddle"> to both sides<BR>> of the equation.<BR>> </span><BR>> <BR>> This works fine when I use a number for the id.<BR>> However I would prefer(reasons involve the rest of the page) to use "hint4" <BR>> for the ID<BR>> When I use hint4 with or without quotes, the whole toggle fails.<BR>> An ALERT inserted in the function returns object for id when I use hint4<BR>> and returns the number when I use a number.<BR>> <BR>> I do not understand.<BR>> Can someone explain what goes wrong when I use id = hint4 ?<BR>> <BR>> Thanks for any help.<BR>> <BR>> Del<BR>> <BR>> <BR>> _______________________________________________<BR>> Javascript mailing list<BR>> Javascript@LaTech.edu<BR>> https://lists.LaTech.edu/mailman/listinfo/javascript<BR><BR><br /><hr />Play free games, earn tickets, get cool prizes! Join Live Search Club. <a href='http://club.live.com/home.aspx?icid=CLUB_wlmailtextlink' target='_new'>Join Live Search Club!</a></body>
</html>