2012-08-22 7 views
11

こんにちは、この問題を解決するネット上で何かを見つけられなかったので、私はこれに関する助けを得ることができますか?こんにちは、iphoneのtwitterブートストラップモーダルボックスでは、ボックスのフッターを取得するスクロールがありません。スクロールバーを助け、与えるかもしれない:iPhoneのスクロールボックスなし

コードは、私が親のdiv(electricityModal ID)にmax-height CSSプロパティを与えることと信じて

<div class="modal hide" id="electricityModal"> 

     <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
      <h3>Submit A Electricity Reading</h3> 
     </div> 

     <div class="modal-body"> 

      <div class="control-group"> 
       <label class="control-label">Date/Time</label> 
        <div class="controls"> 
         <span class="input-medium uneditable-input">22 Aug 2012, 9:45AM</span> 
        </div> 
      </div> 

      <div class="control-group"> 
       <label class="control-label" for="reading-peak">Peak</label> 
       <div class="controls"> 
        <input style="letter-spacing: 10px;" type="text" id="reading-peak" class="input-medium"> 
       </div> 
      </div> 

      <div class="control-group"> 
       <label class="control-label" for="reading-off-peak">Off Peak</label> 
       <div class="controls"> 
        <input style="letter-spacing: 10px;" type="text" id="reading-off-peak" class="input-medium"> 
       </div> 
      </div> 

     </div> 

     <div class="modal-footer"> 
      <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> 
      <button class="btn btn-primary">Lodge Reading</button> 
     </div> 
    </div> 

答えて

20

修正は

@media (max-width: 480px) { 

     .modal { 
      height: 500px; /* Set a default max height of the modal (adjusted later)*/ 
      position: fixed; /* Display modal in the centre of your screen */ 
      overflow-y: scroll; /* Ensure that the modal is scroll-able */ 
      -webkit-overflow-scrolling: touch; /* Avoid having to use 2 finger scroll on iOS */ 
     } 
     .modal.fade.in{ 
      top: 5px; /* Use more screen real estate */ 
     } 
     .modal-body{ 
      /* Increase the max height of the modal body to try & avoid both it, 
      * and the modal container having scroll bars which results in odd behavior */ 
      max-height: 2400px; 
     } 
    } 

    /* Now adjust the height so it handles various screen sizes & orientations */ 
    /* You could make this as granular as you like, or have it more granular at common screen sizes 
    * but it should start at the height we set on .modal (i.e. 500px) & work down */ 
    @media (max-width: 480px) and (max-height: 500px){.modal{ height: 450px}} 
    @media (max-width: 480px) and (max-height: 450px){.modal{ height: 400px}} 
    @media (max-width: 480px) and (max-height: 400px){.modal{ height: 350px}} 
    @media (max-width: 480px) and (max-height: 350px){.modal{ height: 300px}} 
    @media (max-width: 480px) and (max-height: 300px){.modal{ height: 250px}} 
    @media (max-width: 480px) and (max-height: 250px){.modal{ height: 200px}} 
    @media (max-width: 480px) and (max-height: 200px){.modal{ height: 150px}} 
+1

私にとっては、部分的な修正としてのみ働いていました。フォームはスクロール可能ですが、最初のショーでのみ表示されます。一度スクロールするか、内部のフォームオブジェクトを操作しようとすると、全体が再び壊れます。 Heh。共有thoのためにありがとう! – Kirill

+0

これは私の特定の問題を解決しませんでしたが、私を助けました。ありがとう! – kiev

+0

@Kirillに似ていますが、これは私のために_ほとんどです!最初は機能しますが、ドロップダウンリストから値を選択しようとすると(iPhoneが完全に破棄されます)、バグが返されます。私は彼らがこのCSS修正を元に戻す方法でページ要素を変更していると仮定します: –

0

を使用しました。あなたに最も適した高さを選択してください。 250ピクセルのようなものを言う。このため

+1

に沿って修正を見つけサーチしもっとたくさんやった後、機能しなかったことを試してみました(ブートストラップのgithubの問題で見つかった)次のCSSを追加しています。 –

関連する問題