Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android default browser not scrolling web page

I'm having an issue with the stock Android browser on a page I'm building. Simply put, the page won't scroll vertically without zooming in first. I thought I had it figured out when I caught that the tag was reporting a smaller height than the browser window, but fixing that did not cure the scrolling issue. (The black box on the index page reports the calculated height of the element.)

My test device is a Droid Incredible running Android 2.3. Scrolling works in Firefox for Android, as well as my Android 4.0 tablet and all iOS devices.

My dev build of the site is here: www.adamjdesigns.info/csu/engage

EDIT - Other code I've tried:

  1. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  2. if(navigator.userAgent.match(/Android 2/) && $(window).height() < 600) { $('html').css({'height':$(window).height(),'overflow':'auto'}); }

Any help is greatly appreciated!

like image 807
AdamJ Avatar asked Jun 12 '12 18:06

AdamJ


People also ask

Why is my webpage not scrolling?

Your website might not be scrolling if there is a problem with your browser (Google Chrome, Safari, etc.), website code, or your computer hardware. You can investigate & fix the issue by restarting the browser, looking at the site code, deleting cookies, extensions, and/or caches.

Why does my Android not scroll?

And on most devices, the Android phone scrolling problem is caused by corrupted cache files in the system, bad apps, compatibility issues, software glitches, and others.


2 Answers

Though it's a hack, I have another fix that might help developers. I found that with the stock Android 2.3.4 browser, if one increases the initial page load size up from "1" to a slightly increased size, vertical scrolling works without having to pinch zoom first. For example:

<meta name="viewport" content="width=device-width, initial-scale=1.02" />
like image 190
Gatsby Avatar answered Sep 22 '22 21:09

Gatsby


I figured it out! There was an iframe for a YouTube video in the page, and I'm not sure if it's the iframe itself or the related scripting to play the video inside it, but removing that from the DOM solved the issue. (I had it set to hidden on mobile screens anyway.)

Thanks for your help, everyone!

like image 32
AdamJ Avatar answered Sep 23 '22 21:09

AdamJ