I searched for a possible answer to this problem but not much fun at all so far. So maybe you can help; I designed a mobile version for a website and can easily target/redirect to this version from the main desktop layout using this:

```
 // load Mobile version
  if (screen.width <= 999) {
window.location = "http://www.domain/test/Mobile/index.html";

```

}

Works fine when accessing the website on small devices; (iPhones, Androids in portrait & landscape) or tablets (iPads, Kindles, Androids in portrait).

Now I would like to go back to the desktop layout when the tablets (with a: (screen.width >= 1000)) are accessing the website in landscape.

So when in portrait mode (keep the mobile version layout), then when rotated redirect (to the desktop version) better suited to view in landscape.

How best to achieve this, knowing that my coding is limited tho;-) or if there's already an answer for this please let me know.