bootstrap中dialog怎么用

发布时间:2021-09-24 14:49:58 作者:小新
来源:亿速云 阅读:268

这篇文章给大家分享的是有关bootstrap中dialog怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

使用过JQuery UI的应该知道,它里面有一个dialog的弹出框组件,功能也很丰富。

与jQuery UI的dialog类似,Bootstrap里面也内置了弹出框组件。

打开bootstrap 文档http://v3.bootcss.com/components/可以看到它的dialog是直接嵌入到bootstrap.js和bootstrap.css里面的,也就是说,只要我们引入了bootstrap的文件,就可以直接使用它的dialog组件,是不是很方便。

使用示例

通过html代码显示

<!-- Button trigger modal 弹出框的触发器 --><button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">  Launch demo modal</button> <!-- Modal 弹出框的结构 --><div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">  <div class="modal-dialog" role="document">    <div class="modal-content">      <div class="modal-header">        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>        <h5 class="modal-title" id="myModalLabel">Modal title</h5>      </div>      <div class="modal-body">        ...      </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>

这种方式简单直观; 但会增加html的‘重量',而且不够灵活,大量使用时不建议使用

通过js的方式展现

最简单的实现方式:

BootstrapDialog.show({  message: 'Hi Apple!'});

感谢各位的阅读!关于“bootstrap中dialog怎么用”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

推荐阅读:
  1. bootstrap怎么用
  2. dialog属于bootstrap框架吗

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

bootstrap dialog

上一篇:CentOS命令行性能检测工具有哪些

下一篇:如何实现centos yum只更新安全补丁

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》