Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser specific dhtml scripts.

Status
Not open for further replies.

petey

Programmer
Mar 25, 2001
383
US
I was very impressed with the functionality of DHTMLlab.com's hiermenu.js script, which produces very nice and very customizable hierarchial DHTML dropdown menus. This single script works on most modern browsers flawlessly.

The problem is that to make the script work on multiple browsers and platforms, the designers had to add a TON of if/else blocks, conditional statements, configuration functions and the like. The script is nice, but it's a 20k monster.

What I would like to see is a customizable script just like hiermenus.js, but with a different approach:

Instead of one big script that tries to be all things to all browsers, I want a set of small, streamlined scripts that all work perfectly; each in only one type of browser.

You could then conditionally load the appropriate script using the following method:

Code:
if (browser = foo)
document.write(&quot;<script language='javascript' src='fooScript.js'>&quot;);

Anybody know of a resource on the web where such scripts are available? I may try to develop them myself, but I don't want to re-invent the wheel.

Thanks,
Petey
 
Well, I went ahead and disassembled the script after all. I now have two working versions; one for Netscape and one for IExplorer. They are both quite a bit smaller--14k down from 22k.

If you haven't seen this script in action, it is really slick. There is a good working example at If anybody is interested in my &quot;hacked up&quot; version, post back to this forum with your email and I'll send it as .txt. :)

-Petey
 
I feel like I am talking to myself for some reason. Oh, well, I discovered that DHTML Lab actually has come out with a newer version of their script that addresses this problem exactly.
Petey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top