
February 24th, 2001, 08:40 AM
|
|
Junior Member
|
|
Join Date: Feb 2001
Location: Utah
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Maybe not a god, but here goes....
I'm working on a new design using HeirMenus for navigation. The script calls 2 external .js files that hold the array and the menu configuration. Now, as most designers know, you can't use an onload event in 2 different places on a page, they conflict and one won't work. OK- so I have the heir menus and a DHTML text scroller that need loaded. However, the Heir menus don't use a standard window.onload or body onload to call the script. The script uses this: (cut and paste from FAQ regarding this subject)
"The HM onload handler, as we know, calls the startIt() function:
loader.onload = startIt;
We must, therefore, make sure that one onload handler calls both startIt() and startTheOtherTechnique()! Many, if not most, DHTML techniques using an onload handler, begin a dynamic display when the page has loaded. Our fader, and Doc JavaScript's scroller, are two examples. The HM script, on the other hand, does not begin a technique, it simply creates more elements on the page. It, in essence, extends the load procedure and, consequently, should take precedence.
This means that the other script's onload handler should be cut from the page, and pasted into the end of the HM load function:
function startIt() {
isLoaded = true;
if (isFrames) {
menuLoc = eval("parent.frames." + mainFrName);
if (NS4) {
loader.captureEvents(Event.LOAD);
loader.onload = NSloaded;
menuLoc.onunload = NSunloaded;
}
if (IE4) {
menuLoc.document.body.onunload = IEunloaded;
}
}
else {
menuLoc = window;
}
menuLoc.nav = nav = window;
if (clickKill) {
if (NS4) menuLoc.document.captureEvents(Event.MOUSEDOWN);
menuLoc.document.onmousedown = clicked;
}
makeTop();
startTheOtherTechnique(arg1,arg2,...,argn); <-- paste here at end of startIt()
}
Now, the menus will be created, your page elements will be complete, and then your other technique will begin, with no conflict."
Sure! Sounds easy enough! Just slap it on in there! Too bad I can't get it to work! I'm not exactly an expert with Javascript, so I'm not sure how to add this to the code:
window.onload=startscroll
It's the last line in the script for the scroller...
Can someone PLEASE tell me how to do this! I've been pulling my hair out for 2 days on this one! Here's the page if you want to see the whole code:
URL
Thanks in advance!!!
Doug
|