简体   繁体   English

为什么类 modal-side modal-top-right 不适用于 modal bootstrap?

[英]Why class modal-side modal-top-right not working on modal bootstrap?

My code like this :我的代码是这样的:

<div class="modal fade right" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
  <div class="modal-dialog modal-side modal-bottom-right">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title" id="myModalLabel">Basic Modal</h4>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <h3>Modal Body</h3>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

Demo and full code : https://codepen.io/trendingnews/pen/yLyVpOK演示和完整代码: https : //codepen.io/trendingnews/pen/yLyVpOK

I had add class modal-side modal-bottom-right, but it does not works.我添加了类 modal-side modal-bottom-right,但它不起作用。 When the modal opened, it does not on the bottom right当模态打开时,它不在右下角

I get reference from here : https://mdbootstrap.com/docs/jquery/modals/basic/ to put class modal-side modal-bottom-right How can I solve this problem?我从这里得到参考: https : //mdbootstrap.com/docs/jquery/modals/basic/把类 modal-side modal-bottom-right 如何解决这个问题?

The reference you're linking to is for material-design bootstrap .您链接到的参考是用于material-design bootstrap Not twitter-bootstrap .不是twitter-bootstrap md-boostrap extends the functionality of twitter-bootstrap to use the material-design style guide . md-boostrap 扩展了 twitter-bootstrap 的功能以使用material-design style guide You'll need to link both the md-bootstrap CSS and md-boostrap Javascript in addition to jQuery and bootstrap's CSS, JS:除了 jQuery 和 bootstrap 的 CSS、JS 之外,您还需要链接 md-bootstrap CSS 和 md-boostrap Javascript:

Javascript CDN: Javascript CDN:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.10.1/js/mdb.min.js"></script>

And the CSS CDN:和 CSS CDN:

<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.10.1/css/mdb.min.css" rel="stylesheet">

Here is a working example.是一个工作示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM