Not as it’s currently written. The issue is that if you have a header followed by some content, and you mouse out of the header and down over the content, the content would immediately disappear because you moused out of the header. So you’d be flickering back and forth. Can you show an example somewhere that does what you’d prefer? I may be able to dissect the code and see how they’re doing it.
Walter
On May 8, 2012, at 3:14 AM, adellas wrote:
Hello,
Is it possible to close/hide a submenu with scriptyaccordion action either when using mouseout or clicking for a second time on the header?
You could build that precisely with the CSS Menus Action, no need for ScriptyAccordion there. The reason this works is because the submenu items are nested inside the parent item:
containing Pro Bono Work, you haven’t actually left the outer
containing The Firm, so the mouseout event doesn’t fire*. As soon as you mouse entirely out of the The Firm element (and its children), it closes back up again.
Walter
*Actually, they are using CSS, so they don’t have to worry about this at all. In JavaScript, though event they would be using here is ‘mouseleave’, which is more useful than mouseout. Mouseout would fire immediately when you crossed over from the outermost ‘
The Firm’ into the next inner layer of ‘
Pro Bono Work
’, because you are no longer exclusively over the outermost element. This can drive you nuts. Mouseleave was invented by Microsoft, and is supported by most modern browsers, and simulated by Prototype 1.7 in any browser that doesn’t have native support for it.