无需编写JavaScript代码即可生成一个对话框。在一个主控元素,例如按钮,上设置data-toggle="modal"
,然后再设置data-target="#foo"
或href="#foo"
用以指向某个将要被启动的对话框。
仅用一行JavaScript代码即可启动id为myModal
的对话框:
上面的选项都可以通过data属性或JavaScript代码传递给组件。对于data属性,将选项名称附着于data-
字符串之后,就像data-backdrop=""
一样。
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
backdrop | boolean | true |
Includes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click. |
keyboard | boolean | true | Closes the modal when escape key is pressed |
show | boolean | true | Shows the modal when initialized. |
remote | path | false |
If a remote url is provided, content will be loaded via jQuery's
|
让你指定的内容变成一个模态对话框。接受一个可选的参数object
.
手动打开或隐藏一个模态对话框。
手动打开一个模态对话框。
手动隐藏一个模态对话框。
Bootstrap中的模态对话框对外暴露了一些事件允许你监听。
事件 | 描述 |
---|---|
show |
This event fires immediately when the show instance method is called. |
shown | This event is fired when the modal has been made visible to the user (will wait for css transitions to complete). |
hide |
This event is fired immediately when the hide instance method has been called. |
hidden | This event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete). |
下载说明
☉本站所有源码和资源均由站长亲自测试-绝对保证都可以架设,运营!
☉如源码和资源有损坏或所有链接均不能下载,请告知管理员,
☉本站软件和源码大部分为站长独资,资源购买和收集,放心下载!
☉唯一站长QQ:1004003180 [人格担保-本站注重诚信!]
☉购买建议E-mail:1004003180@qq.com 源码收购 E-mail:1004003180@qq.com
☉本站文件解压密码 【文章内都自带解压密码,每个密码不同!】