BootStrap笔记-Model(模式对话框)样式修改

x33g5p2x  于2022-02-28 转载在 Bootstrap  
字(1.5k)|赞(0)|评价(0)|浏览(734)

BootStrap的模式对话框比Qt的用起来简单。

如要实现下面效果:

对应的html代码如下:

  1. <button type="button" class="btn btn-dark border text-white w-100" data-bs-toggle="modal" data-bs-target="#exampleModalToggle">购买</button>
  2. <div class="modal fade" style="border-color: white" id="exampleModalToggle" aria-hidden="true" aria-labelledby="exampleModalToggleLabel" tabindex="-1">
  3. <div class="modal-dialog modal-dialog-centered">
  4. <div class="modal-content bg-dark text-white" style="border-color: white">
  5. <div class="modal-header bg-dark text-white">
  6. <h5 class="modal-title" id="exampleModalToggleLabel">提示</h5>
  7. <button type="button" class="bg-transparent border-0" data-bs-dismiss="modal" aria-label="Close"><img src="./icon/x-circle-fill.svg"></button>
  8. </div>
  9. <div class="modal-body bg-dark text-white">
  10. 是否确认购买
  11. </div>
  12. <div class="modal-footer">
  13. <button type="button" class="btn text-white border bg-dark" data-bs-dismiss="modal">取消</button>
  14. <button type="button" class="btn text-white border bg-dark" onclick="purchaseProduction()">确定</button>
  15. </div>
  16. </div>
  17. </div>
  18. </div>

其中点击确定后调用purchaseProduction()对应的js如下:

  1. <script>
  2. function purchaseProduction(){
  3. console.log("here");
  4. }
  5. </script>

相关文章

最新文章

更多