November 21, 201015 yr I have mental block on this one, and would really appreciate somone to give me a second pair of eyes on something In IE only the "ID is null or not an object" error , citing the following line: content = $(tab.id + "_data") Works beautifully in FF etc.. The issue is then that in IE that the Divs the tabs controll just stack under eachother, rather than shwing the active pane For infomation purposes - this is inthe magento/prototype/scriptilicious environment Any ideas? var richardstabs = { tabContainerID: "navBar", tabs: new Array(), initialize: function() { }, createTabs: function() { var classObject = this; this.tabs = $$("#navBar div"); this.tabs.each(function(el) { Event.observe($(el), "click", function() { classObject.switchTab(el); }); }); this.switchTab($(this.tabs[0])); }, switchTab: function(tab) { content = $(tab.id + "_data"); if (content) { this.tabs.pluck("id").each(function(elid) { $(elid).className = ""; $(elid + "_data").hide(); }); tab.className = "activeTab"; content.show(); } else {} } }; document.observe("dom:loaded", function() { richardstabs.createTabs(); });
Create an account or sign in to comment