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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:08:51+00:00 2026-05-29T12:08:51+00:00

I am creating an iOS web app that has a fixed div (say 200px

  • 0

I am creating an iOS web app that has a fixed div (say 200px height) and the content inside of that scrolls. I don’t like the default iOS scrolling, as it’s not like the native scrolling you find by just swiping down through a webpage (the native scrolling in iOS has momentum, while the default one for overflow is without momentum).

The div I am trying to scroll in has the following qualities:

  1. Set width
  2. Dynamic height (content via AJAX)

The content is loaded from an external website into a div using jQuery AJAX, and there is an option to reload the AJAX request. This means that, depending on the amount of content in the loaded page, the height of the div will change.

I can’t seem to find any solutions that allow momentum scrolling in iOS where the div doesn’t have a set with, and I’ve tried the following:

  1. - webkit-overflow-scrolling: touch
  2. iScroll

And the problems with these:

  1. This was my first choice, as it’s just a css tag and usually works fine. It’s new though and has a lot of bugs, including a deal breaker one for my web app. If you focus on an input element, the page zooms in (even with the meta tag set to user-scalable:no) and doesn’t zoom out until you type text in the text box, and then everything is off by 3px.
  2. This solution is laggy and the height needs to be fixed. Using it’s refresh function is too cumbersome as it needs to be called when the AJAX request is reloaded, when the page is reloaded, if elements are hidden, etc.

TL;DR: Are there any solutions other than -webkit-overflow-scrolling and iScroll that will allow me to use momentum scrolling on a div with a dynamic height (content loaded in via AJAX) in iOS?

  • 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-29T12:08:53+00:00Added an answer on May 29, 2026 at 12:08 pm

    What I currently do to overcome the dynamic height issue is setting the height after the DOM is updated. I do this by using the following code:

    document.getElementById('content').style.height = window.innerHeight - getPosition('loading')[1] + "px";
    

    In this example the main DIV is ‘content’ and I have a span right above that DIV called loading which it uses as a reference point since the header changes in size depending on what part of the webapp you are on. Below is the getPosition function:

    function getPosition(who){
    var e = document.getElementById(who);
    var position = {x:0,y:0};
    while (e) {
        position.x += e.offsetLeft;
        position.y += e.offsetTop;
        e = e.offsetParent;
    }
    return [position.x , position.y];};
    

    Additionally, I believe the zoom has been fixed since iOS 5.0.1.

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

Sidebar

Related Questions

I am creating an iOS app that displays a web view. How can I
I'm creating iOS app that has a label. I want to set two colors.
We're creating a game that will run on iOS, Android and in the web
I am creating an iOS app that reads data from a single SQLITE table
I’m currently creating an iOS app that uploads files to a server. As multiple
I have an app in Flash CS5 that I am creating for iOS. I
Let's say I have a web app that calls out to a native app
I'm creating a web-database driven offline web-app targeted at iOS devices. I'm trying to
I am creating an iOS app that reads data from an xml file. One
When creating a web application, and lets say you have a User object denoting

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.