ControlTabs weird init in IE6

I have a set of tabs like this:

<ul id="sendtabs" class="controltabs">
  <li><a href="#html">HTML</a></li>
  <li><a href="#plain">Plain</a></li>
</ul>

And I fire up a Control.Tabs instance for it like this:

sendtabs = new Control.Tabs($('sendtabs'));

That works everywhere except IE6 where I get a "Object doesn't support this property or method" error on that line. As a workaround, I tried this, which weirdly, works just fine!

$$("ul.controltabs").each(function(tabs){
  var sendtabs = new Control.Tabs(tabs);
});

This set of tabs is the only one on the page, so I would expect that to resolve to exactly the same entity as the previous example. Can anyone think of a good reason for this? I'm running a patched (using the hash patch form this forum) Control.Tabs 2.1.1 with Prototype 1.6.0.1.

Posted January 24th, 2008 at 7:21am by Synchro

FWIW, this is how those references look in Firebug's console:

>>> $$("ul.controltabs")
[ul#sendtabs.controltabs]
>>> $('sendtabs')
<ul id="sendtabs" class="controltabs">

They look reasonably equivalent to me...

Posted January 24th, 2008 at 8:33am by Synchro

Login or Register to Post