Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



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

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
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)
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to 'Sticky' Menus
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.14541 seconds with 13 queries