【发布时间】:2016-03-11 14:24:26
【问题描述】:
我在 php/codeIgniter 工作。但是我的问题与引导模式有关。
我编写的 Modal 的 HTML 如下:
<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">×</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>
我正在使用 Bootstrap,但是我为 Modal 添加了一些自定义 css,仅此而已,如下所示:
.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');
}
我已通过 contact-us 链接将模态框放在 footer 中。
现在的问题是模态框不随网络浏览器页面的默认滚动条。我使用的是 google-chrome。
任何形式的帮助将不胜感激。
【问题讨论】:
-
这是因为页面上有multiple modals吗?
-
页面上有模态框,但是它们与 MVC 中的视图不同。即使在同一页面上加载的不同视图中,模态也会产生影响吗?
-
不,他们不会:)。我认为链接的帖子可能与您的问题有关,因为您不会期望这样的事情。
-
欢迎优秀的cmets。我发现我使用的是自定义 bootstrap.css 文件。当我切换到官方引导程序时,一切都恢复正常了。
标签: javascript php html css twitter-bootstrap