View Single Post
Old 11-30-2006, 11:08 AM   #6 (permalink)
StupidScript
Senior Member
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 663
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Javascript, in answer to your last question. Flash is too proprietary to depend on for many users over many years, although it can be used to do some pretty cool things. You don't need it for this.

What you can do with pure CSS is, basically, "crop" a container. It's "cropped" to hide the submenu and then "expanded" to reveal the submenu on ":hover".
Code:
<style ...> #menu1 { left:20px;top:40px;position:absolute;clip:rect(0,24,12,0) } #menu1:hover { clip:rect(0,24,24,0) } </style> ... <div id="menu1" style=">Menu Item<br />SubItem 1</div>
"Clip" ("crop") that box so only "Menu Item" is visible, and onmouseover (":hover"), expand the visible area to include the submenu.

Clipping can only be applied to an absolutely-positioned element, so that's the tricky part, really.

Keep in mind that some browsers respond to the :hover condition on a DIV element and some do not, so ... ya takes ya chances ... and ... if they don't have Javascript enabled, they won't be able to use the CSS, either. It's driven by the same engine.

Last edited by StupidScript; 11-30-2006 at 11:14 AM.. Reason: Touch up, add end comment
StupidScript is offline   Reply With Quote