Careful what you ask for, you just might get it. There are several problems that arise once these smartfolding unordered lists get triggered onmouseOver. For one a list extends all the way across a page unless contained within a fixed width element. I had the best luck with a table but still the list extends to the largest possible area it can logically encompass, making the mouse over target area much larger than one might like. That somewhat solved, in IE, the most widely used browser, lists extend for the entire height of their contained elements, once again expanding the target area for mouse over beyond what one would prefer. I came up with a way of restricting the target area but, it excludes the folder image, a decent compromise under the circumstances and it did away with the need for a container like the table I mentioned above. Remember though, that before all this, a click was required to expand/contract a list. Now, a mouse over does this. As a result, things jump around sometimes when you least expect it but, as I said at the beginning, that's what you asked for. Here's how:
Change this line in the script:
Code:
cur=ns6? e.target : event.srcElement
to:
Code:
cur=ns6? e : event.srcElement
and get rid of these two lines:
Code:
if (ie4||ns6)
document.onclick=checkcontained
Now, the html markup has to change, where it once looked like this:
HTML Code:
<li id="foldheader">News</li>
make it look like this:
HTML Code:
<li id="foldheader"><span onmouseOver="checkcontained(this.parentNode)">News</span></li>
Make this change only for those li's that have the foldheader id. That's all there is to it. I have a feeling you will either want further modifications though, or decide that onclick wasn't so bad after all.
Bookmarks