CSS is for providing a mechanism to control how the information appears visually. It contains no capability to pause/'progress' with respect to time.
( (()
(`-' _\
'' ''
Main Topics
Browse All TopicsHi,
I've created a vertical slider menu along the lines of the suckerfish menus, it works well too. There's a tiny bit of javascript which adds the OVER class to the li elements so that it works for IE.
I want it so that when a user accidentally slips off the menu with the mouse it remains in the slided out state (if it is already) for a given small period. I'm heavily into sticking everything in CSS files where possible, I also think that tables are the devil's own work (unless displaying genuine tabular data), and also have to make this W3C compatible and satisfy accessibility rules too.
I'd like a trim solution that, if possible, doesn't involve mentioning the 'onmouseover' and 'onmouseout' events in the HTML, and at most making the relevant li elements part of a class or something that is manipulated somehow in CSS or javascript.
500 points because I'm probably being demanding!
Thanks
Iain
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
Thanks for the responses.
I was tempted to use .htc files when initially doing the hover events, however, the solution I have already works, although I suspect this represents an arguably better way of solving the problem of making IE behave properly. The solution I have does not reference mouseover events, I just have the following javascript:
<script language="javascript">
startList = function(){
var sfEls = document.getElementById("n
for (var i=0; i<sfEls.length; i++)
{
sfEls[i].onmouseover=funct
{
this.className+=" over";
}
sfEls[i].onmouseout=functi
{
this.className=this.classN
}}}
window.onload=startList;
</script>
The timeout solution I am after will not be able to use the behaviour style because it will need to work in all browers.
If you look at the site http://www.regenwm.co.uk you'll see what I mean, a slight delay when you move off the menus and no mouseevents referenced in the html...and no behaviours...wow... how are they doing this?
From viewing the source the only clues are that the included .js file they have is called navBar and some of the li elements have a classname of menuItem.....
Cheers
Iain
Hi,
I mirrored the intended site and the answer indeed lay in the .js file they had there, not in the CSS as I'd originialy thought. Basically, it's some code from www.dhtmlgoodies.com.
Points to rowdy_h though for giving me the code for .htc files which has since proved useful elsewhere in my work!
Thanks
Iain
Business Accounts
Answer for Membership
by: rowdy_hPosted on 2006-08-13 at 09:57:46ID: 17305864
Unfortunately I don't think you can create a delay like that in css.
I can give you some advice on tidying up your html for the javascript "fix" to IE that allows the hover to work on non link elements. The following allows you to avoid referencing mouseover events in your html.
If you create a file (I called mine hover.htc) and put the following in it.
<public:component>
<public:attach event="onmouseover" onevent="hover()" />
<public:attach event="onmouseout" onevent="restore()" />
<script language="JavaScript">
var normalClass;
function hover()
{
normalClass = element.className;
element.className = normalClass + 'hover';
}
function restore()
{
element.className = normalClass;
}
</script>
</public:component>
This javascript appends hover on to the end of the class name whenever the mouse is over the element, so if you have a class called menu for example for non-IE browsers you would have menu:hover where you wanted to set the hover styles you also tell it to apply the same styles to menuhover.
To set which elements are affected by this set the element to have style
behavior:url(hover.htc);
As behavior is an IE only style setting this solution rather neatly applies the javascript only to the browser that has the problem :)
I'd be interested if anyone does manage to solve the menu delay issue with css as I'd be keen to use it too, but I'm not going to use javascript to achieve it.