|
![]()
|
Step 1 - The ScriptThe script is in 2 parts cbddm.js and vars.js. vars.js is where you change the few values that make the menu work the way you want. There is more about vars.js here. Link to vars.js using cbddm.js does not require any editing or modification. you just upload it, link to it from the webpage and forget all about it. Link to cbddm.js using There is upto 3 things that need to be called from body onload If you are using the news layer then use this If your page has a form use this This bit is for nosey people :) The script itself isn't that complicated really, the problems arose from a lack of standards (as usual). Mozilla and IE use practically identical code - very little tweaking needed to make these 2 browsers happy. Netscape 6 comes close but uses different syntax for certain things which is really annoying. For example : because an open menu can potentially open wider than the document width some, calculations were required to make sure that this doesn't happen. Opera, Mozilla and MSIE all use document.body.clientWidth to return the document width. Netscape 6 decide to use window.innerWidth which personally I think is odd as it is based on mozilla (so they say:) MSIE, Mozilla and Netscape 6 all seem to understand offsetLeft and offsetTop however Opera seems to only like offsetLeft but not if you are using tables (another oddity) as getElementById is supposed to make finding things easier, I can't understand why Opera has a hard time with it. Netscape 4x is just a pain but if you have tried to do anything useful with Netscape 4x you'll know some of the problems associated with it. So, if you are nosing through the code and wonder why certain bits where done certain ways you now know the answer :) |
| |
copyright © Andrew Holt 2000/2006 |