2013-07-03 100 views
1

我有一個移動網頁,我已禁用水平滾動,因爲它干擾了我正在做的一些動畫。但是,當我在html和body上設置overflow-x:hidden時,android由於某種原因失去了垂直滾動的功能。 iPad似乎仍然有效。我對Android 2.3的,如果它的事項Android瀏覽器禁用X滾動禁用Y滾動以及

這是問題的一些示例代碼:具有

<!doctype html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 

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

    <style type="text/css"> 
     html,body { 
      position:absolute; 
      height:100%; 
      width:100%; 
      padding:0px; 
      margin:0px; 
      overflow-x:hidden; 
     } 

     .content span { 
      white-space:nowrap; 
      display:block; 
     } 
    </style> 
    </head> 
    <body> 
    <div class="content"> 
     <span>Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling.</span> 

     <span>1</span> 
     <span>2</span> 
     <span>3</span> 
     <span>4</span> 
     <span>5</span> 
     <span>6</span> 
     <span>7</span> 
     <span>8</span> 
     <span>9</span> 

     <span>1</span> 
     <span>2</span> 
     <span>3</span> 
     <span>4</span> 
     <span>5</span> 
     <span>6</span> 
     <span>7</span> 
     <span>8</span> 
     <span>9</span> 

     <span>1</span> 
     <span>2</span> 
     <span>3</span> 
     <span>4</span> 
     <span>5</span> 
     <span>6</span> 
     <span>7</span> 
     <span>8</span> 
     <span>9</span> 

     <span>1</span> 
     <span>2</span> 
     <span>3</span> 
     <span>4</span> 
     <span>5</span> 
     <span>6</span> 
     <span>7</span> 
     <span>8</span> 
     <span>9</span> 

     <span>1</span> 
     <span>2</span> 
     <span>3</span> 
     <span>4</span> 
     <span>5</span> 
     <span>6</span> 
     <span>7</span> 
     <span>8</span> 
     <span>9</span> 

     <span>1</span> 
     <span>2</span> 
     <span>3</span> 
     <span>4</span> 
     <span>5</span> 
     <span>6</span> 
     <span>7</span> 
     <span>8</span> 
     <span>9</span> 
    </div> 
    </body> 
</html> 

回答

0

I'm有類似的問題,但是從我所看到到現在what's防止滾動

height: 100%; 

嘗試評論留置權的Android 2.X,你可能會讓它再次滾動。

請讓知道,如果你找到一種方法,可以在其中保持

html, body { 
height: 100%; 
} 

而且還在滾動。

謝謝,祝你好運 -