POPUP/POPDOWN
POPUP/POPDOWN
Have two minor problems
1) Cannot get overflow="scroll" working with popup or displayMenu
Works fine with showmenu
2) If I have a large submenu that uses popup, then when mouseover closes properly. But actually justs hides, and does not reset mouse control under popup. (Example href link under popup cannot access until reset by going to main menu)
Again if called from showmenu, mouseover close resets mouse control properly
Any suggestions would be helpful
Thanks Dave
1) Cannot get overflow="scroll" working with popup or displayMenu
Works fine with showmenu
2) If I have a large submenu that uses popup, then when mouseover closes properly. But actually justs hides, and does not reset mouse control under popup. (Example href link under popup cannot access until reset by going to main menu)
Again if called from showmenu, mouseover close resets mouse control properly
Any suggestions would be helpful
Thanks Dave
A url would be the most helpful thing in order to see what's going on. I just put a long long submenu into a pop menu and set it to overflow="scroll" it seemed to work OK. So, browser where the problem occurs, OS and a test page would be the most helpful so we can see what's happening. I'm not sure I understand what you're saying is going wrong.
Ruth
Ruth
URL
Cannot give out url, system in an accounting database system.
Key is pop menu is a submenu without left/top set, but location based on parent. System uses allBuildMenu and spos to set the pos of menu on return to set location.
System automatically opens submenu on load.
Here is function that gets pos from cookie, sets spos and calls popup
Thanks Dave
function getcookiemenu(mainmenu) {
var cookie = getcookie(mainmenu);
c1 = cookie.indexOf(",",0);
c2 = cookie.indexOf(",",c1+1);
c3 = cookie.indexOf(",",c2+1);
c4 = cookie.indexOf(",",c3+1);
menuinfo = cookie.substr(0,c1);
toppos = cookie.substr(c1+1,c2-c1-1);
leftpos = cookie.substr(c2+1,c3-c2-1);
heightpos = cookie.substr(c3+1,c4-c3-1);
widthpos = cookie.substr(c4+1,cookie.length);
if (toppos != "")
{
menuNumber = getMenuByName(menuinfo);
spos(gmobj("menu" + menuNumber),toppos,leftpos,null,null);
popup(menuinfo);
}
return
}
Key is pop menu is a submenu without left/top set, but location based on parent. System uses allBuildMenu and spos to set the pos of menu on return to set location.
System automatically opens submenu on load.
Here is function that gets pos from cookie, sets spos and calls popup
Thanks Dave
function getcookiemenu(mainmenu) {
var cookie = getcookie(mainmenu);
c1 = cookie.indexOf(",",0);
c2 = cookie.indexOf(",",c1+1);
c3 = cookie.indexOf(",",c2+1);
c4 = cookie.indexOf(",",c3+1);
menuinfo = cookie.substr(0,c1);
toppos = cookie.substr(c1+1,c2-c1-1);
leftpos = cookie.substr(c2+1,c3-c2-1);
heightpos = cookie.substr(c3+1,c4-c3-1);
widthpos = cookie.substr(c4+1,cookie.length);
if (toppos != "")
{
menuNumber = getMenuByName(menuinfo);
spos(gmobj("menu" + menuNumber),toppos,leftpos,null,null);
popup(menuinfo);
}
return
}
popi problem
I do always have main menu displayed.
I can get itemnumber by using following function; but try to call popi(item#) and get errmsg saying object expected.
Do alert and do get an item number after calling following function
function mm_getItemByName(itemName)
{
for (i=0; i<_mi.length; i++) if (_mi[1].indexOf(itemName) != -1) return i;
return -1;
}
are you sure it is popi()? Maybe different spelling. am I missing something? Is popi function something I have to load
Thanks for the help
Dave
I can get itemnumber by using following function; but try to call popi(item#) and get errmsg saying object expected.
Do alert and do get an item number after calling following function
function mm_getItemByName(itemName)
{
for (i=0; i<_mi.length; i++) if (_mi[1].indexOf(itemName) != -1) return i;
return -1;
}
are you sure it is popi()? Maybe different spelling. am I missing something? Is popi function something I have to load
Thanks for the help
Dave
test with popi
I did some testing, and _popi does work if call after page is loaded; but when try to run calling onload does not.
Seems that even though onload is called, the routine wants to load before the main menu.
Any way to get routine to run after main menus are opened
Thanks for help Dave
Seems that even though onload is called, the routine wants to load before the main menu.
Any way to get routine to run after main menus are opened
Thanks for help Dave
Is this any help?
http://milonic.com/openmenusbyurl.js
it opens the menus based on the current url.
-- Andy
http://milonic.com/openmenusbyurl.js
it opens the menus based on the current url.
-- Andy
openmenusbyurl.js
Tried, but no luck. No menus display except main menu.
I called routine after drawmenus() call; even tried before just in case. I assume problem is same as my problem. You are calling popi routine and it is being run before menus are drawn.
I put an alert 1st line in _ocURL() function to see if called after draw menus;
ocURL() is called 5 times; and 3-4 are called before main menu displays
Hope this helps you isolate problem
I assume we are close; mine is working well except for the scroll and url items after closed
Is there anyway to test that main menus are drawn before calling our routines?
Thanks for all your support; I am getting good responses from my clients
Dave
I called routine after drawmenus() call; even tried before just in case. I assume problem is same as my problem. You are calling popi routine and it is being run before menus are drawn.
I put an alert 1st line in _ocURL() function to see if called after draw menus;
ocURL() is called 5 times; and 3-4 are called before main menu displays
Hope this helps you isolate problem
I assume we are close; mine is working well except for the scroll and url items after closed
Is there anyway to test that main menus are drawn before calling our routines?
Thanks for all your support; I am getting good responses from my clients
Dave
Re: openmenusbyurl.js
Hi Dave,
mm_isOpen(menuName) is a function that checks to see if a menu is open. It takes one parameter, menuName, which is the name of the menu to check. e.g., mm_isOpen("Main Menu") will return true if the menu named "Main Menu" is open, false if not.
mm_runWhenOpened(menuName, functionToRun) is a recursive function that will check to see if a named menu is open, and after the named menu is open will run a specified function. The mm_runWhenOpened() takes two parameters. menuName is the name of the menu to wait for (wait until it's opened) and functionToRun is the function that you want to run once the named menu is open. funcitonToRun must be a string expression, with any passed parameters specified literally. If you want to include variable in the parameters to pass, then build functionToRun as a separate string before passing it to mm_runWhenOpened().
In the above code, there's an example function called testFunction() that you would replace with your own function (i.e., whatever you want to run after the main menu appears).
So, suppose my main menu is named "Main Menu". Once "Main Menu" is open, I want to run testFunction() and pass it the name of a sub menu called "Products Submenu". At the bottom of my menu_data.js, after the call to drawMenus(), I would put:
With my testFunction(), after the main menu appears, an alert pops up with the text, "I'm now doing whatever with the menu named: Products Submenu". You would, of course, substitute your own function (get cookies, pop a menu, etc.).
Hope that helps,
Kevin
I have some functions that may help. You could put the following code at the top of you your menu_data.js file:dhaack wrote:...Is there anyway to test that main menus are drawn before calling our routines?...
Code: Select all
var runWhenOpenedTimer = 0;
function mm_isOpen(menuName)
{
menuObj = gmobj("menu" + getMenuByName(menuName));
if (ns4) {
return (menuObj.visibility == "show");
}
else {
return (menuObj.style.visibility != "hidden");
}
}
function mm_runWhenOpened(menuName, functionToRun)
{
var checkInterval = 100; //msec
var funcStr = "mm_runWhenOpened("" + menuName + "", " + """ + functionToRun + "")";
if (! mm_isOpen(menuName)) {
runWhenOpenedTimer = setTimeout(funcStr, checkInterval);
}
else {
clearTimeout(runWhenOpenedTimer);
runWhenOpenedTimer = setTimeout(functionToRun, 0);
}
}
function testFunction(menuName)
{
alert("I'm now doing whatever with the menu named: " + menuName);
}
mm_runWhenOpened(menuName, functionToRun) is a recursive function that will check to see if a named menu is open, and after the named menu is open will run a specified function. The mm_runWhenOpened() takes two parameters. menuName is the name of the menu to wait for (wait until it's opened) and functionToRun is the function that you want to run once the named menu is open. funcitonToRun must be a string expression, with any passed parameters specified literally. If you want to include variable in the parameters to pass, then build functionToRun as a separate string before passing it to mm_runWhenOpened().
In the above code, there's an example function called testFunction() that you would replace with your own function (i.e., whatever you want to run after the main menu appears).
So, suppose my main menu is named "Main Menu". Once "Main Menu" is open, I want to run testFunction() and pass it the name of a sub menu called "Products Submenu". At the bottom of my menu_data.js, after the call to drawMenus(), I would put:
Code: Select all
// first derive the name of the sub menu however you need to
var subMenuName = "Products Submenu";
// now build the function string to pass
var functionString = "testFunction('" + subMenuName + "')";
// start the waiting...
mm_runWhenOpened("Main Menu", functionString);
Hope that helps,
Kevin
run function on open routines
Works perfectly; now I can use popi which handles scroll and href under menus properly.
Thanks for all your help
Dave
Thanks for all your help
Dave