How can I fire an event when orientation is changed on a mobile device.
onresize works fine 开发者_JAVA技巧on iPod Touch but not on mobile device using Opera mobile as browser.
Any help on how to fire event on Opera mobile.
Thanks,
Abhishek Jain
I've racked the web trying to find a good solution to this, I was in the same boat. There dosn't seem to be any really fantastic solutions out there, but what I use is this. Like I said not the best option, but mobile and mini Opera don't seem to fire anything catchable when the screen is resized. Since I'm looking at mobile devices I set the viewport to which ever (width/height) is smallest. When the user turns their device it will at least be kind of intuative.
Edit: I actually did this and coupled it together with a update width&height routine on my div's, based on screen.width/height, and it turned out pretty good.
精彩评论