Is it okay to combine cases
that share assignments and repeat the case
for assignments that are not shared, or is it preferred to just keep each se
It can't work. As soon as a break instruction is executed, the remaining code in the switch block is not executed. You could fix it like this:
switch(window.orientation) {
case 0:
case 180:
w = 330;
case 0:
x = '-180px';
break;
case 180:
x = '-80px';
break;
case -90:
case 90:
w = 480;
x = '0';
break;
}