Topic: JavaScript onMouseOut help... (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: las vegas, nevada, us |
posted 03-23-2007 01:06
ok I have an image that has an onMouseOver placing a <div> over it, and this <div> has three "child" images in it, what I was doing before the images with onMouseOut was just fine but now with the images if I go over one of them the <div> hides how can I make the images in the <div> keep it shown as well? |
Paranoid (IV) Inmate From: Norway |
posted 03-23-2007 01:14 |
Paranoid (IV) Inmate From: las vegas, nevada, us |
posted 03-23-2007 01:17
hehe yeh, onmouseout, I just got it wrong for the example there! it's onmouseout in the real script! |
Paranoid (IV) Inmate From: Norway |
posted 03-23-2007 01:44
posting your actual JavaScript might help code: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <title>foo</title> <style type="text/css"> body { background:#000; color:#ccc; margin:0; padding:0; font:12px Trebuchet ms; } #d1 { position:relative; width:128px; height:128px; background:orange; color:#000; } #d1.show #d2 { display:block; } #d2 { position:absolute; top:0; left:0; width:100%; height:100%; background:green; display:none; } </style> </head> <body> <p>lorem</p> <div id='d1' onmouseover='this.className="show"' onmouseout='this.className=""'> <img src='base.img.png' alt='base'/> <div id='d2'> <img src='1st.img.png' alt='1st' /> <img src='2nd.img.png' alt='2nd' /> </div> </div> <p>lipsum</p> </body> </html> For a cleaner, and CSS only version, remove all the inline event crap, and replace .show by :hover in the CSS |
Paranoid (IV) Inmate From: las vegas, nevada, us |
posted 03-23-2007 01:54
it's on my pc, and I only have it positioned in FF right now so IE will be funny looking until I work all this out then add a proper offset for IE. |
Paranoid (IV) Inmate From: Norway |
posted 03-23-2007 02:20
Ok, the mouseout event is fired when you move the mouse over an IMG inside the linkframed. |
Paranoid (IV) Inmate From: las vegas, nevada, us |
posted 03-23-2007 06:28
I don't get how using UL's would get the same effect. |
Paranoid (IV) Inmate From: Norway |
posted 03-23-2007 10:11 |