echology
echology

Reputation: 397

Bootsrap Modal does not scroll with the default browser page scroll bar

I am working in php/codeIgniter. However my question is related to Bootstrap Modal.
The HTML for the Modal that I have written is below:

<li><a href="#contactmodel" data-toggle="modal">Contact us</a>
    <div id="contactmodel" class="modal fade cmodal" role="dialog">
        <div class="modal-dialog modal-sm" role="document">                             
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title cus-modal-title">Contact Us | <span class="cus-modal-stitle">have your say...</span></h4>
                        </div>
                        <div class="modal-body">
                           <div class="col-md-10 col-md-offset-1 cus-model-margin">
                 <?php
                    $attributes = array('name' => 'contactform',
                    'target' => '_self',
                    'id' => 'contact', 'class' => 'htmlform' 
                     );
                     echo form_open('contactus', $attributes);
                     ?>                 
    <div class="form-group">
    <input type="text" class="form-control inputstyle-text" name="nick" id="nick" placeholder="Write your nick name ..." ng-model="nick" type="text" required pattern="^[A-Za-z]{5,15}$" title="Only alphabets allowed. Min. 2 & Max. 15" style="text-transform: lowercase">  <span class="glyphicon glyphicon-user" style="color: red"></span></input>
    </div>
    <div class="form-group">
    <input type="email" class="form-control inputstyle-text" name="email" id="email" placeholder="Write your email ..." ng-model="email" required type="email"   style="text-transform: lowercase">  <span class="glyphicon glyphicon-envelope" style="color: red"></span></input>
    </div>
    <div class="form-group">
    <textarea class="form-control text-style" rows="5" name="msg" id="msg" placeholder="Anything to say ..." ng-model="text" type="msg" required pattern="^[A-Za-z]{100,300}$" title="Only alphabets allowed. Max. 300" style="text-transform: lowercase"> </textarea>  <span class="glyphicon glyphicon-font" style="color: red"></span>
    </div>
    <div class="form-group">
    <button type="submit" name="submit" class="btn btn-primary">Send  <span class="glyphicon glyphicon-envelope" style="color: black"></span></button>
    </div>
            <?php echo form_close(); ?>             
                </div>  
                                        </div>
                                    </div>                          
                                </div>
                        </div>                          
                    </li>  

I have working Bootstrap however I have added some custom css for the Modal and no more, which is below:

.cus-modal-title{

     color: black;
     text-align: left !important;

 }
 .cus-modal-stitle{

     font-size: 10px;   

  }
  .cus-model-margin{

      margin-left: 0.333333% !important;
   }
   .modal.fade.in {

      top: 40% !important;
    }
    .cmodal{

      z-index: 1051 !important;

     }
     a:focus {

        outline: thin dotted #333;
        outline: 0px auto -webkit-focus-ring-color !important; 
        outline-offset: -2px;
      }
      .cus-model-body{

        background: url('../images/content.png');

       }

I have placed the Modal in the footer with the contact-us link.
Now the issue is that the modal does not scroll with the default scroll bar of the web browser page. I am using google-chrome.
Any kind of help help will be much appreciated.

Upvotes: 1

Views: 255

Answers (2)

Manish Kumar
Manish Kumar

Reputation: 1176

This is because of position property applied to '.modal-dailog' class.

If you want modal to scroll with the browser scrollbar, then position must be set to fixed for '.modal-dailog' class. I think, by default, it's absolute and hides the browser's scrollbar so that user will never be able to scroll the window and modal will always be on screen.

Thanks

Upvotes: 0

echology
echology

Reputation: 397

The issue was resolved when I downloaded the official bootstrap css and replaced with the older one as it had been modified.

Upvotes: 1

Related Questions