PDA

View Full Version : Script does not work when flashvideo on page...


alexw
07-24-2009, 10:23 PM
Hi everyone!
I'm new to jacascript and I just made a little script to change the class of a tag by clicking it on my website. the script works fine at most of the pages. But when i load a page, where i have a flashvideo playing the script won't work and i'm absolutly helpless with this problem...

so pleaes help me...

website:
http://www.number-one.ch/

problematic page: click summer in the menu and there it is...

script code:
function ChangeClass(id,nr) {

switch(nr) {
case 1:
var NAME = new Array();

NAME[0]="mhome";
NAME[1]="msummer";
NAME[2]="mwinter";
NAME[3]="mconsort";
NAME[4]="mimpressions";
NAME[5]="mcontact";
NAME[6]="mstatement";

for(i = 0; i < 7; i++){
var x = document.getElementById(NAME[i]);
if(x.className=="menu1active"){
x.className="menu1";
}
}

var y = document.getElementById(id);
y.className="menu1active";
break;

case 2:
var NAME = new Array();

NAME[0]="mabout";
NAME[1]="msbc";
NAME[2]="mnob";
NAME[3]="mlongb";
NAME[4]="mskim";

for(i = 0; i < 5; i++){
var x = document.getElementById(NAME[i]);
if(x.className=="menu2active"){
x.className="menu2";
}
}

var y = document.getElementById(id);
y.className="menu2active";
break;

default:
break;
}
}


the script is called by:
onclick="ChangeClass('mhome',1);"

so yes, if anyone could help me, that would be perfect!!

alexw
07-25-2009, 01:21 PM
solved....

I had a simple fault in my html-file....