jyotimehta
11-11-2003, 01:37 PM
I am using Hiermenus.js v3.10.3 00073. It works fine for all pages except
few page where I use onload as <body ONLOAD="next()"> .
How I can use Hiermenu functionality by having <body ONLOAD="next()"> .
dragle
11-12-2003, 08:45 AM
Hi,
Unfortunately that older version of HM does not provide a graceful way to honor the existing onload of the page when it is initialized; so on stand alone pages where you've specified both an HM load and your own custom load only one will actually execute (whichever came later).
You could easily modify the HM code to honor an existing onload, however, providing you load the HM scripts within the body of the document (or after your last onload assignment for the page). Change this line, at the top of the script:
loader.onload = startIt;
to this:
previousOnload=(loader.onload)?loader.onload:null;
loader.onload = startIt;
And then add this block to startIt:
function startIt() {
if(previousOnload) {
previousOnload();
previousOnload=null;
}
This is untested, but should work for you. Again, for this to work, the HM scripts will have to be loaded after you have assigned your own onload statement.
Cheers!