2012-07-19 20 views
3

textarea中的垂直滾動條顯示在I.E,FF和Chrome中,但不在像ipod/ipad這樣的i-os設備中。如何在textarea的i-os設備中顯示垂直滾動條?

<textarea id="termsConditions" cols="30" rows="5" readonly="readonly">Sample text sample   text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample</textarea> 

如何解決此問題?

非常感謝。

+0

看到這樣的回答: 這對你有幫助嗎? – 2012-08-04 03:37:16

回答

6

就像Michael Halpin所說的那樣。將-webkit-overflow-scrolling: touch添加到您的樣式中。

HTML

<textarea id="termsConditions" cols="30" rows="5" readonly="readonly">Sample text sample   text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample</textarea> 

CSS

#termsConditions { 
    overflow: auto; 
    -webkit-overflow-scrolling: touch; 
}​ 

DEMO