To detect a screen orientation change in Javascript you can use the following snippet.
Sample Javascript
window.addEventListener("orientationchange", function() {
//0 = potrait
//90 or -90 = landscape left or landscape right
}, false);
some devices do not fire the orientationchange event, try the resize event instead.
Sample Javascript
window.addEventListener("resize", function() {
// check screen size (inner and outer!)
}, false);
RT @CodeSnippetsNET: Detect screen orientation change in #Javascript http://t.co/nLwL86xwNi #js #jquery #html #php
RT @CodeSnippetsNET: Detect screen orientation change in #Javascript http://t.co/nLwL86xwNi #js #jquery #html #php
RT @CodeSnippetsNET: Detect screen orientation change in #Javascript http://t.co/nLwL86xwNi #js #jquery #html #php