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 8866211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:44:01+00:00 2026-06-14T16:44:01+00:00

I am using a JQuery parallax slider effect. Everything fits the screen on iPad

  • 0

I am using a JQuery parallax slider effect. Everything fits the screen on iPad except when I rotate from landscape to portrait there is a about a 120px right margin that pushes my slider content over to the right.

I have tried setting viewport tag

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

but this did nothing. when I go to the page directly in portrait it is fine. The right margin is only added when I rotate from landscape to portrait. Portrait to landscape resizes appropriately.

here is example
demo

  • 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-14T16:44:04+00:00Added an answer on June 14, 2026 at 4:44 pm

    A quick, dirty fix would probably be to execute a method to reset the margins when the onorientationchange event is triggered on the body.

    So example code would be as follows:

    <body onorientationchange= "fixMargins()">
    
    ....
    
    function fixMargins() {
        var orientation = window.orientation;
        switch (orientation) {
            case 0: // portrait 
                $('div').css('margin-right', '40px');
                break;
            case 90: // landscape left
                $('div').css('margin-right', '40px');
                break;
            case -90: //landscape right
                $('div').css('margin-right', '40px');
                break;
            case 180: // portrait upside down
                $('div').css('margin-right', '40px');
                break;
        }
    }
    

    Obviously this is not ideal and you would prefer an explanation for why this happens. But I just thought I’d suggest this as a quick fix

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using LayerSlider - The Parallax Effect Slider built in JQuery which is a
Using Jquery AJAX to get a value from a PHP script. This line works
Using jQuery, how do I get the value from a textbox and then load
Using jQuery what's the way to get all elements of a queried set EXCEPT
Using jquery, I'd like to get the javascript from an A tag's onClick attribute.
Using jQuery and backbone.js, I would like to separate the JavaScript from the HTML
SLIDER CODE http://tympanus.net/codrops/2012/03/15/parallax-content-slider-with-css3-and-jquery/ IMAGE MOCK: I'd like to preface this by saying I'm not
Using jQuery's flot, there's a way to allow items to be selected by hovering
I'm making a jquery parallax effect where when the user first hovers the mouse
Using jQuery, how do you check if there is an option selected in a

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.