Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6249735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:17:39+00:00 2026-05-24T13:17:39+00:00

I am using jquery-mobile and it seems it doesn’t detect the landscape setting. What

  • 0

I am using jquery-mobile and it seems it doesn’t detect the landscape setting. What I am using:

iphone simulator Version 4.3 (238.2) from Xcode Version 4.1 Build 4B110
jquery mobile

I tried to do this in my mobile.js

$(window).bind('orientationchange resize', function(event){
  alert(event.orientation)
})

and turning the simulator around just keeps giving me an alert that says “portrait” when it clearly should be landscape.

am i doing something wrong here? I also tried using media queries in our jammit call:

<%= include_stylesheet :landscape, :media => "all and (orientation: landscape)" %>

but to no avail. AM i doing something wrong here?

The main bug btw is that even when turning the iphone, the display still stays at portrait width for us.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:17:39+00:00Added an answer on May 24, 2026 at 1:17 pm

    I found this in the jQM b2 js file:

    • http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.js

    JS:

    alert('Orientation: ' + jQuery.event.special.orientationchange.orientation());
    

    Here is the function itself:

    // Get the current page orientation. This method is exposed publicly, should it
    // be needed, as jQuery.event.special.orientationchange.orientation()
    $.event.special.orientationchange.orientation = get_orientation = function() {
        var elem = document.documentElement;
        return elem && elem.clientWidth / elem.clientHeight < 1.1 ? "portrait" : "landscape";
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: I'm using jQuery and jQuery Mobile. I have a mobile page which seems
I'm using jquery-mobile and jquery-ui and it seems the dialogs or conflicting with each
I’m using a jQuery mobile slider in a JQM dialog but it’s not being
In JQuery Mobile I am using changePage() to redirect back to a previous page,
I am trying to mask SSN input using jquery mask plugin, however it doesn't
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
I'm using jquery.mobile-1.0.1. I'm trying to make the page reload when clicking on the
I'm trying to remove the 'ui-btn-active' class from this JQuery Mobile markup piece: <a
I am using jquery mobile alpha 4. I simply bind a click event on
I am trying to develop a mobile application using JQUERY mobile. For its data,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.