Is there a way to detect screen orientation change?
I need this to trigger a function which updates the variable used in split-pane when attribute. In my app user can customize the split pane appearance and this is the only way I can make it work properly.
This code works when running in browser but not in android device.
window.addEventListener(“orientationchange”, function() {
alert(window.orientation);
}, false);
There was no need to detect screen orientation at all. If you give to the when attribute a string value it handles all by itself. So instead of giving a boolean value I set split pane when attribute like this: