Results 1 to 4 of 4

Thread: IE only error in mouse over menu

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

    Talking IE only error in mouse over menu

    New here and noticed that you guys have some great solutions. Convinced me to sign up and join. Maybe I would be able to help out as well.


    I am using the Mouseover Tabs Menu, I attached the .js file below.
    It works great on all browsers except of course for IE.
    Whenever I run the script I get the small annoying yellow error at the bottom indicating the page loaded but with errors.

    Line:21
    Error: Object doesn't support this property or method

    Here is the block of code. Line 21 begins with if (/^gotsubmenu/i.test(relattr)
    Any clue on what do I need to do in order to solve this?

    Thanks in advance!

    Code:
    initializetabs:function(tabsmenuid, submenuid, tabcontentsLength, disappearBool){
    	var tabmenu=document.getElementById(tabsmenuid)
    	var tablinks=tabmenu.getElementsByTagName("a")
    	var submenu=document.getElementById(submenuid)
    	var selected=null, tablinks_count=0
    	for (var i=0; i<tablinks.length; i++){
    		tablinks[i]._parentid=tabsmenuid
    		var relattr=tablinks[i].getAttribute("rel")
    		if (/^gotsubmenu/i.test(relattr) && tablinks_count<tabcontentsLength){ //if "rel" attribute starts with="gotsubmenu" and a tab content exists for this tab based on its order
    			tablinks[i]._pos=tablinks_count //remember position of this tab relative to its active peers
    			if (relattr.indexOf("[selected]")!=-1){
    				selected=tablinks_count
    			}
    			this.addEvent(tablinks[i], function(){
    				var tabsmenutree=mouseovertabsmenu.tabsmenutree[this._parentid]
    				mouseovertabsmenu.clearhidetimer(tabsmenutree.submenu.hidetimer)
    				mouseovertabsmenu.showsubmenu(this)
    			}, "mouseover")
    			tablinks_count++
    			this.tabsmenutree[tabsmenuid].tabs.push(tablinks[i]) //add this tab to tab collection
    		}
    		else{ //else for regular tab links (with no "rel" attribute)
    			this.addEvent(tablinks[i], function(){
    				mouseovertabsmenu.hidesubmenu(this._parentid)
    			}, "mouseover")
    		}
    	}

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Do you have a link to the problem page we can check out? Also, by IE, I gather you mean IE7?
    DD Admin

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yea IE7,
    Don't have a link sorry, Any chance of getting it from the code?

  4. #4
    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

    Not from the code you've posted. Most likely you've mixed things up a little with the installation. Does the script still work in IE 7? If so, there is probably also an error in other browsers, you just aren't aware of it.

    And the problem is probably actually with this preceding line:

    Code:
    var relattr=tablinks[i].getAttribute("rel")
    which probably means that you either have a tablink in your HTML code with no rel, or have initialized out of order, perhaps even initialized once out of order and a second time in the correct place. But it could be something else.

    Go back over the installation instructions and make sure you have followed them correctly.

    If you want more help you could post the code to the page, though it may still be hard to pinpoint with only that. Best thing would be if you could put up a page somewhere on the web that demonstrates this issue and post a link to it here. It doesn't have to look good or even be a part of any site, just a single page that shows the problem.
    - 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
  •