Why is the orientationchange event never getting fired in my JQM app?
I am alerting a message on orientationchange.
$(window).bind("o开发者_开发技巧rientationchange", function(e){
alert('orientation change');
});
Also, if you notice the class names on the body tag, the portrait/landscape class name never changes like it does in the JQM demos -- it just stays at whatever it was when you loaded the page. Any help debugging this unusual problem is greatly appreciated.
EDIT Sorry i forgot to leave a link to my project :/
http://www.foodtrucksmap.com/m/la
// Get the current page orientation. This method is exposed publicly, should it
// be needed, as jQuery.event.special.orientationchange.orientation()
- http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.js
Try:
$(window).bind( 'orientationchange', function(e){
alert(jQuery.event.special.orientationchange.orientation());
});
精彩评论