var fmt = document.documentElement.clientWidth;
var cls = (fmt<=240)?'pda_ver':(fmt>240&&fmt<=320)?'pda_hor':(fmt>320&&fmt<=640)?'screen_ultralow':(fmt>640&&fmt<=800)?'screen_low':(fmt>800&&fmt<=1024)?'screen_med':(fmt>1024&&fmt<=1280)?'screen_high':'screen_wide';
can someone tell me what this does (just the part where the variable is set with a value. I do not understand… what are the ?, : have for a role here)? i have never seen a variable declared like that. Is this a conditional variable setting? if yes how does it work ?
This is a horrible example of abuse of the ternary operator.
Using a switch statement would look much nicer.