PDA

View Full Version : Dynanic Generation of Chrome Menu



ad316
12-08-2006, 05:31 AM
1) Script Title: Chrome CSS Drop Down Menu (v2.01)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm

3) Describe problem: I've been using version 2.0 of the Chrome menu and I've been able to dynamically generate the menu. Meaning, I add the appropriate elements to the DOM (i.e. <divs>, <uls>, etc) that the menu needs through Javascript based upon certain criteria. I then call cssdropdown.startchrome and the menu is generated. I'm now using version 2.1. Firefox works fine, but IE only displays the IFrameshim. Any suggestions?

Also, is version 2.0 that fixed the FF 2.0 problem available? Thanks for your help.

ddadmin
12-08-2006, 11:15 AM
Well version 2.01 is identical to version 2.0 except for the iframe shim feature. If you disable that in the script, it should basically behave the same as 2.0, dynamically generated (the HTML nodes) or not:


enableiframeshim: 1, //0 disables it in .js file

ad316
12-08-2006, 09:41 PM
Thanks very much. Unfortunately, changing the enableiftameshim value to 0 didn't fully work for me.

However, I was able to fix the problem by commenting out the "if" statement at the end of chrome.js:
if (window.createPopup && !window.XmlHttpRequest) . . .

The problem doesn't appear when all is static, but dynamic generation causes the problem. (Realizing that generating chrome dynamically is pushing it). In a future version, you may wish to not run the if statement when enableiftameshim=0.

Thanks for the help, the menu is great.

ddadmin
12-10-2006, 07:07 AM
Ah well, by removing the last chunk of code starting from "if", you do disable even the HTML for the iframe shim to be written out, not just the feature. You're right, I should probably modify the setting so disabling the iframe shim will include disabling its HTML from being written out.