I want my code to run after menus are displayed; but no matter where I put code, seems to run before drawmenus.
Tried body onload; seperate <script></script> at end of body.
Please any help would be useful
Thanks Dave
force my javascript to run after drawmenus
Here is code I want to run
function getcookiemenu(mainmenu) {
var cookie = getcookie(mainmenu);
comma1 = cookie.indexOf(",",0);
comma2 = cookie.indexOf(",",comma1+1);
comma3 = cookie.indexOf(",",comma2+1);
comma4 = cookie.indexOf(",",comma3+1);
menuinfo = cookie.substr(0,comma1);
toppos = cookie.substr(comma1+1,comma2-comma1-1);
left = cookie.substr(comma2+1,comma3-comma2-1);
height = cookie.substr(comma3+1,comma4-comma3-1);
width = cookie.substr(comma4+1,cookie.length);
if (toppos != "")
{
menuNumber = getMenuByName(menuinfo);
spos(gmobj("menu" + menuNumber),toppos,left,null,null);
popup(menuinfo);
}
return
}
Routine calls cookie that stores last position and menu used; sets position using spos and then calls popup.
Problem is runs before drawmenus so does not display detail data
var cookie = getcookie(mainmenu);
comma1 = cookie.indexOf(",",0);
comma2 = cookie.indexOf(",",comma1+1);
comma3 = cookie.indexOf(",",comma2+1);
comma4 = cookie.indexOf(",",comma3+1);
menuinfo = cookie.substr(0,comma1);
toppos = cookie.substr(comma1+1,comma2-comma1-1);
left = cookie.substr(comma2+1,comma3-comma2-1);
height = cookie.substr(comma3+1,comma4-comma3-1);
width = cookie.substr(comma4+1,cookie.length);
if (toppos != "")
{
menuNumber = getMenuByName(menuinfo);
spos(gmobj("menu" + menuNumber),toppos,left,null,null);
popup(menuinfo);
}
return
}
Routine calls cookie that stores last position and menu used; sets position using spos and then calls popup.
Problem is runs before drawmenus so does not display detail data
no luck
I have tried that already and no luck. Problem is internal functions of Milonic have onload when I look at the programs.
Need way to force drawmenus() to completely load onload, then run my script.
Thanks for trying
Dave
Need way to force drawmenus() to completely load onload, then run my script.
Thanks for trying
Dave
Hi,
For the record, the menu does not use document.onload at all. This is free for your use. The onload's that you are seeing in the code is for some images as we need to know the size etc.
Anyway, the problem might be due to the fact that the sub menus are not built at loadtime. They are only built when needed. If you want to build them all at loadtime you could add buildAllMenus=true; to the top of your menu_data.js file.
Basically, there are a number of reason why your code isn't running in the correct place. Seeing a URL will help alot so that I can run a few testes and see what is happening.
Cheers
Andy
For the record, the menu does not use document.onload at all. This is free for your use. The onload's that you are seeing in the code is for some images as we need to know the size etc.
Anyway, the problem might be due to the fact that the sub menus are not built at loadtime. They are only built when needed. If you want to build them all at loadtime you could add buildAllMenus=true; to the top of your menu_data.js file.
Basically, there are a number of reason why your code isn't running in the correct place. Seeing a URL will help alot so that I can run a few testes and see what is happening.
Cheers
Andy
buildAllMenus
Fixed problem, so if anybody else is having trouble
Works like a charm
Thanks for support
Dave
Works like a charm
Thanks for support
Dave