popup submenu on Load
popup submenu on Load
I am attempting to get a certain submenu to be open by default when a page loads. However, calls to both menuDisplay and popup do not work. In fact, I am able to get the numeric menu ID by name using getMenuByName, but when I pass the same name to gmobj, it returns null. Am I missing something? Thanks.
Aaron
Aaron
Hi Aaron,
There was a function written to open subs automatically onload. Perhaps that will help. AutoOpenSubsOnLoad
Ruth
There was a function written to open subs automatically onload. Perhaps that will help. AutoOpenSubsOnLoad
Ruth
Hi Aaron,
Working on the next phase, eh... getting the menu that was open on the previous page to open again on the next page? Just out of curiousity, are you passing the _itemRef from one page to the next as a url parameter?
So... a few alternatives to try.
Cheers,
Kevin
Working on the next phase, eh... getting the menu that was open on the previous page to open again on the next page? Just out of curiousity, are you passing the _itemRef from one page to the next as a url parameter?
I seem to recall that there was a recent bug fix in v5.7 that may be affecting you (the bug, that is, noyt the fix). According to the version info page:aaronz wrote:I am attempting to get a certain submenu to be open by default when a page loads. However, calls to both menuDisplay and popup do not work.
I would imagine that this same bug could be affecting the menuDisplay() function as well. If I recall our previous work together, your submenus are set to alwaysvisible=0, and then the custom function we made sets alwaysvisible=1 to achieve the desired result. But when you go to the next page and the .js files are reloaded, alwaysvisible=0 again for your submenus. So, if you have v5.691(or earlier) the bug would give you a problem using popup() to open the submenu. v5.7 is in a pre-release stage right now, but I believe it will be released soon. I've been using it on our staging server with no ill effects. Try downloading the pre-release and see if that fixes the popup() issue for you. Alternatively, you could do what we did before and set the menu's alwaysvisible property to 1 before calling menuDisplay() or popup(). Finally, I've run into situations before where if you try to open a menu too quickly after the page loads, then the function doesn't work. In those situations, I've used setTimeout() to introduce a brief delay (100 or 200 msec) before attempting to open the menu; that usually works.version infor for 5.7 wrote:Fixed bug with popup menus not displaying when alwaysvisible was declared as zero
So... a few alternatives to try.
I'm guessing that you're using gmobj() in conjunction with menuDisplay()... right? Using the internal menu methods can be tricky at first. If you want to post the code you're using, I'll have a look.aaronz wrote:In fact, I am able to get the numeric menu ID by name using getMenuByName, but when I pass the same name to gmobj, it returns null. Am I missing somethin?
Cheers,
Kevin
This did help somewhat, thanks!There was a function written to open subs automatically onload. Perhaps that will help. AutoOpenSubsOnLoad
This did the trick after I implemented a modified version of the above function. However, my biggest question is whether the required delay is going to vary based on the technical specification of the client's machine. Is this something I should be concerned about?I've used setTimeout() to introduce a brief delay (100 or 200 msec) before attempting to open the menu; that usually works.
Thanks to both of you!
Aaron
If you're relying heavily on the delay, then yes, you should be concerned; I'm sure you're thinking that slower connections will still yield the same problem you had before.aaronz wrote:[However, my biggest question is whether the required delay is going to vary based on the technical specification of the client's machine. Is this something I should be concerned about?
Did you try version 5.7? I just happend to be doing something similar on our staging site right now (popup a particular menu as soon as the page loads). I had some problems until I switched to 5.7.
Are you setting the menu's alwaysvisible property to 1 before calling popup()?
Are you using popup() or have you tried menuDisplay() again? (I sometimes have better results with that, depending on what I'm trying to do).
When you say that the function calls don't work, what error message are you getting (object doesn't exist?). If it's a non-existent object error, can you determine whether it's the function or the menu that doesn't exist when you need it?
If you want to post a url to your test page, I could have a look and maybe make some specific suggestions. (Same url as before?)
Cheers,
Kevin
Yep... I'm using 5.7 for all of this. Didn't seem to make a difference when I switched to it..Did you try version 5.7? I just happend to be doing something similar on our staging site right now (popup a particular menu as soon as the page loads). I had some problems until I switched to 5.7.
Yes, although I am using menuDisplay(), not popUp()... I haven't been able to popUp to work under any circumstances.Are you setting the menu's alwaysvisible property to 1 before calling popup()?
Yes, there's no error message, actually. The menu does exist, for I've been able to return a reference to it using gmobj() with an alert command... so, my assumption is that the function doesn't exist. Why that doesn't result in an error message, however, is beyond me.When you say that the function calls don't work, what error message are you getting (object doesn't exist?). If it's a non-existent object error, can you determine whether it's the function or the menu that doesn't exist when you need it?
http://www.input.com/_milonicIf you want to post a url to your test page, I could have a look and maybe make some specific suggestions. (Same url as before?)
...Also, my employers are also now requesting that I apply a tabbed-look to the menu, which is going to prove difficult without being able to dynamically change the source image of separator graphics... I'll probably have to start a new topic for this, but if you've got any ideas for that, I'm all ears
Hi,
I'm having the same problem Aaron was experiencing. I am trying to get a specific submenu to display automatically when a page loads, but calls to menuDisplay() and popup() do not work. I am able to get the numeric menu ID by name using getMenuByName, but when I pass the same name to gmobj, it returns null for all of my submenus but one. I can't see any difference in the way I defined the submenu for which gmobj returns an object.
I tried calling the AutoOpenSubsOnLoad() function mentioned earlier in the thread, but got a JavaScript error. I couldn't find any documentation on this function, and the link to the function in this thread does not seem to be working. At any rate, I am not sure this function would be a solution, unless it allows me to specify which submenu to open on page load.
Thanks in advance,
Krog
I'm having the same problem Aaron was experiencing. I am trying to get a specific submenu to display automatically when a page loads, but calls to menuDisplay() and popup() do not work. I am able to get the numeric menu ID by name using getMenuByName, but when I pass the same name to gmobj, it returns null for all of my submenus but one. I can't see any difference in the way I defined the submenu for which gmobj returns an object.
I tried calling the AutoOpenSubsOnLoad() function mentioned earlier in the thread, but got a JavaScript error. I couldn't find any documentation on this function, and the link to the function in this thread does not seem to be working. At any rate, I am not sure this function would be a solution, unless it allows me to specify which submenu to open on page load.
Thanks in advance,
Krog
I too am in need of the ability to re-display a specific menu when the page loads.
I've been playing around with the Automatic Menu Opening Module openmenusbyurl.js version 1.3 (http://milonic.com/openmenusbyurl.js); however since upgrading to version 1.3, I can no longer "cheat" the script as I described in this thread: viewtopic.php?t=5913
I use two different Milonic menus on my dev site (http://dev.hanover.edu/) but I only need the second menu to work with the module. Is there any way to accomplish this?
Thanks,
Ben
I've been playing around with the Automatic Menu Opening Module openmenusbyurl.js version 1.3 (http://milonic.com/openmenusbyurl.js); however since upgrading to version 1.3, I can no longer "cheat" the script as I described in this thread: viewtopic.php?t=5913
I use two different Milonic menus on my dev site (http://dev.hanover.edu/) but I only need the second menu to work with the module. Is there any way to accomplish this?
Thanks,
Ben
HCBen,
Try upgrading to version 1.4 of the Automatic Menu Opening Module at http://milonic.com/openmenusbyurl.js available as of today. It has a new parameter called called "forceChildSubOpen" which seems to do the trick quite nicely! (I've tried it and it does display the appropriate submenus automatically.)
Krog
Try upgrading to version 1.4 of the Automatic Menu Opening Module at http://milonic.com/openmenusbyurl.js available as of today. It has a new parameter called called "forceChildSubOpen" which seems to do the trick quite nicely! (I've tried it and it does display the appropriate submenus automatically.)
Krog