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

  • Home
  • SEARCH
  • 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 9035241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:42:32+00:00 2026-06-16T08:42:32+00:00

I am creating an ios/android app with phonegap(cordova) framework. My UI code is little

  • 0

I am creating an ios/android app with phonegap(cordova) framework. My UI code is little bit lacking in horizontal orientation. So, I want to change the look and feel only for horizontal orientation and not for vertical. Is there a condition which i can apply in index.html to achieve this, preferrably in javascript/jquery. Thanks in advance.

  • 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-06-16T08:42:33+00:00Added an answer on June 16, 2026 at 8:42 am

    You can create an event listener for the event onOrientationChange() in which you can probably change the css file which applies in a particular orientation.

    // create the link tag for the css file in your head section
    <HEAD>
    <LINK ID="OrientationSpecificCSSTag" REL="stylesheet" TYPE="text/css" HREF=""> // keep the href empty, will set later
    .....
    </HEAD>
    

    Now attach the event listener in your javascript file or your script tag

    // attach the onOrientationChange event listener in your script tag
    window.addEventListener( 'onorientationchange', OnOrientationChange, false );
    

    Implement the OnOrientationChange function which actually changes the css files according to the orientation

    function OnOrientationChange()
    {
        // case: if portrait
        if( window.orientation == 0 || window.orientation == 270 )
        {
             document.getElementById('OrientationSpecificCSSTag').HREF = 'landscape.css';
        }
        else
        {
             document.getElementById('OrientationSpecificCSSTag').HREF = 'portrait.css';
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently creating a hybrid mobile app (see phonegap/cordova) for iOS and Android
I am using phonegap(cordova 2.1.0) for IOS/android app development. Every time i have to
Setup: I am developing a PhoneGap/Cordova app for iOS and Android using jQuery Mobile.
I am creating an app for iOS, Android and Blackberry and am using phonegap
I am creating a quiz style app for iOS using phonegap. The app allows
I'm now creating a native app for blackberry, android, and iOS. I have a
I am creating an iOS and Android app. The app will track the same
I am creating a tablet app (both iOS and Android) I have a menu
I'm creating iOS app that has a label. I want to set two colors.
I'm working on a phonegap-app for Android/iOS. If I understand correctly, if someone opens

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.