I would prefer not to use jquery just for simplicity. I have three websites which one page cycles through. I want the webpages to be scaled each by a different scalar value. I t
You need break statements to prevent the switch from falling through to the next statement.
switch(i)
{
case 0:
document.getElementById('frame').className = 'first';
break;
case 1:
document.getElementById('frame').className = 'second';
break;
case 2:
document.getElementById('frame').className = 'third';
break;
}
Your switch statement is failing because it lacks a break
statement at the end of each case. Without break
, the proper case and any cases below it will execute. That is why "only the third one works"