开发者

Why is the orientationchange event never getting fired in my JQM app?

开发者 https://www.devze.com 2023-03-28 17:53 出处:网络
I am alerting a message on orientationchange. $(window).bind(\"o开发者_开发技巧rientationchange\", function(e){

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());
});
0

精彩评论

暂无评论...
验证码 换一张
取 消