I've just moved from native iOS dev to cross platform. I'm using phonegap and I would like to create different layouts based on device screen size and orientation. What I would like to do is something similar to this code
if(orientation == LANDSCAPE)
{
if(screen.width < 320)
{
//use css #1
}
else
{
//use css #2
}
}
else //orientation is PORTRAIT
{
if(screen.width < 320)
{
//use css #3
}
else
{
//use css #4
}
}
Or if it's not the appropriate way to do design, then how do I do it?