Forum Moderators: open
I am having a problem (or two) with the accordion class in mootools. I have created an accordion feature in a website I am designing and I'm having some big issues only in Internet Explorer 6. When the page first loads, it comes up with a script error (I have "show all script errors" turned on) that states that its an invalid property value, but thats about the only useful information it tells me. After the page loads if you refresh it it displays everything perfectly. I am really stumped here. Does anyone have any ideas to why this is happening? My javascript code is as follows:
// Defines the Accordion
function AccordionInit() {
var accTitle = $$('.menuTitle');
var accContent = $$('.content');
var pwAccordion = new Accordion(
accTitle, accContent, { // Defines selected tab
onActive: function(tog){
tog.addClass('selected');
var accTitleOnOff = new Fx.Styles(tog, {wait: false, duration: 350});
accTitleOnOff.start({
'background-color': '#e87f2a',
'color': '#ffffff',
'text-indent': '30%',
'padding-left': 0
});
},
onBackground: function(tog){ // Defines tab when unselected
tog.removeClass('selected');
var accTitleOnOff = new Fx.Styles(tog, {wait: false, duration: 350});
accTitleOnOff.start({
'background-color': '#224b4a',
'background': 'none',
'color': '#ffffff',
'text-indent': '25%',
'padding-left': 0
});
},
alwaysHide: false,
duration: 500,
fixedHeight: 245,
opacity: true,
display: Math.floor(Math.random()*6)
}
);
// Mouse effects
accTitle.each(function(div) {
var mouseFxs = new Fx.Styles(div, {duration: 150, wait: false});
div.addEvents({
'mouseover': function(){ // Tab hover
if (!div.hasClass('selected')) {
mouseFxs.start({
'color': '#ffffff',
'text-indent': '30%',
'padding-left': 0
});
}
},
'mouseout': function(){ // Tab Mouseout
if (!div.hasClass('selected')) {
mouseFxs.start({
'background': 'none',
'color': '#ffffff',
'text-indent': '25%',
'padding-left': 0
});
}
}
});
});
}
window.addEvent('domready', function(){
AccordionInit();
});
[edited by: encyclo at 1:10 am (utc) on April 17, 2007]
[edit reason] no URLs please, see TOS #13 [webmasterworld.com] [/edit]