Reply
'Sticky' Menus
Old 04-23-2006, 07:54 PM 'Sticky' Menus
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,108
Location: Toronto, Ontario
I realize this is a large script (compared to other help requests in this forum), but I thought I might ask anyway incase someone wanted to spend their afternoon looking over some Javascript

Here's the demo page: <removed>
Here's the script: <removed>
(Using prototype and script.aculo.us for slide up/down effect).

<For archival purposes, see attachment instead for JS>

It works well enough, but there are still a few bugs. One is, if you quickly mouse over several menus, some of them 'stick' (don't close). For example, put you mouse by the 'home' link and quickly move it all the way to the right. Instead of closing each menu when a new one opens, or closing them on document onmouseover, they stick.

The script keeps an internal record of what menus are open (osMenu.open_menus, right now only one menu is meant to be open at a time, but this if for future extension). After debugging, I found the array to be empty. So somehow they are going through the close routines... but not closing lol.

So if anyone has any ideas give me a shout

Edit
After much tinkering, I fixed it

The slide effects are animations and are thus are running at an interval. My close menu methods worked fine, but the running interval would re-set the states of the menus (making them re-appear in the correct position). The solution is to keep track of all active effects, and cancel them when closing them (if they aren't already finished). The Effect object created to make the slide effects has a cancel() method that will cancel the effect, and this is what I ended up using.
Attached Files
File Type: zip menu.zip (1.3 KB, 2 views)
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
When You Register, These Ads Go Away!
     
Reply     « Reply to 'Sticky' Menus
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12265 seconds with 14 queries