Results 1 to 3 of 3

Thread: enablereveal property: JS error

  1. #1
    Join Date
    Apr 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default enablereveal property: JS error

    1) Script Title:
    Chrome CSS Drop Down Menu (v2.5)

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...mejs/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!
    Last edited by whirlgirlz; 04-28-2009 at 08:57 PM. Reason: clarification

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I found the actual error, add the highlighted line to this function in chrome.js:

    Code:
    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")
    },
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •