EFrost
08-26-2007, 03:26 PM
Hey,
I am having some problems getting a function to work in IE, when it works in other browsers.
function toggleC (obj)
{
var cats = obj.parentNode.getElementsByClassName('category');
var effects = [];
for (var i = 0; i < cats.length; i++)
{
if (cats[i].tagName == "DIV" && cats[i].parentNode.id == obj.parentNode.id)
{
if (cats[i].id != obj.id)
{
if (Element.visible(cats[i])) {
effects.push( new Effect.SlideUp(cats[i],{sync: true, duration: 0.5 }) );
}
} else
{
if (!Element.visible(cats[i])) {
effects.push( new Effect.SlideDown(cats[i],{sync: true, duration: 0.4}) );
} else effects.push( new Effect.SlideUp(cats[i],{sync: true, duration: 0.4}) );
}
}
}
new Effect.Parallel(effects, {duration: 0.4});
}
For some reason, the first line of the function is firing a error.
IE is saying that the object that I'm searching for doesn't support the method. Basically the function is called from a icon inside the div ( toggleC(this); ).
Any help is hugely appreciated !
I am having some problems getting a function to work in IE, when it works in other browsers.
function toggleC (obj)
{
var cats = obj.parentNode.getElementsByClassName('category');
var effects = [];
for (var i = 0; i < cats.length; i++)
{
if (cats[i].tagName == "DIV" && cats[i].parentNode.id == obj.parentNode.id)
{
if (cats[i].id != obj.id)
{
if (Element.visible(cats[i])) {
effects.push( new Effect.SlideUp(cats[i],{sync: true, duration: 0.5 }) );
}
} else
{
if (!Element.visible(cats[i])) {
effects.push( new Effect.SlideDown(cats[i],{sync: true, duration: 0.4}) );
} else effects.push( new Effect.SlideUp(cats[i],{sync: true, duration: 0.4}) );
}
}
}
new Effect.Parallel(effects, {duration: 0.4});
}
For some reason, the first line of the function is firing a error.
IE is saying that the object that I'm searching for doesn't support the method. Basically the function is called from a icon inside the div ( toggleC(this); ).
Any help is hugely appreciated !