PDA

View Full Version : enablereveal property: JS error



whirlgirlz
04-28-2009, 08:57 PM
1) Script Title:
Chrome CSS Drop Down Menu (v2.5)

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

3) Describe problem:
When 'enablereveal' parameter in 'chrome.js' is set to 'false', it throws an 'Invalid argument' JS error. Anyone else seen this or know where the issue may lie?

GREAT script, by the way! It's flexible and clean - the best I've come across.

Thank you!

jscheuer1
04-29-2009, 06:49 AM
This only appears to be an issue in IE, and doesn't seem to break the script - just throws an error. You can get basically the same effect, with no error by setting it to:


enablereveal: [true, 1],

I suggest this approach because IE error reporting is not giving me a line number that appears to relate to this setting in any way that I can see.

jscheuer1
04-29-2009, 06:57 AM
I found the actual error, add the highlighted line to this function in chrome.js:


showmenu:function(dropmenu, e){
if (this.enablereveal[0]){
if (!dropmenu._trueheight || dropmenu._trueheight<10)
dropmenu._trueheight=dropmenu.offsetHeight
clearTimeout(this.revealtimers[dropmenu.id])
dropmenu.style.height=dropmenu._curheight=0
dropmenu.style.overflow="hidden"
dropmenu.style.visibility="visible"
this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu)}, 10)
}
else{
dropmenu.style.visibility="visible"
dropmenu._trueheight=dropmenu.offsetHeight
}
this.css(this.asscmenuitem, "selected", "add")
},