用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
## 模态框 模态框使用BootStrap 实现,可以绑定所有BootStrap的事件。 [TOC] ### 语法说明 ``` hdjs.modal(options); ``` ### 参数说明 | 参数 | 说明 | | --- | --- | | title | 标题 | | content | 内容 | | footer | 底部 | | id | 模态框id,默认为hdMessage | | width | 宽度 | | class | 模态框样式 | | option: {} | bootstrap模态框选项 | | events: {} | 事件,参考bootstrap | > 方法会返回模态框的JS对象 ### 基本使用 ``` <script> require(['hdjs'], function (hdjs) { hdjs.modal({ title: '友情提示你哟',//标题 content: '后盾人 人人做后盾',//内容 footer: '<button type="button" class="btn btn-default confirm" data-dismiss="modal">关闭</button>',//底部 width: 600,//宽度 events: { confirm: function () { //哪个元素上有.confirm类,被点击就执行这个回调 alert('点击了关闭按钮'); } } }); },function(modal){ //bootstrap 模态框对象 console.log(modal); }); </script> ``` ### 远程加载 ``` <script> require(['hdjs'], function (hdjs) { hdjs.modal({ content: ['http://localhost'],//加载的远程地址 title: '添加用户', width: 800, show: true,//直接显示 }); }); </script> ``` ### POST远程加载 ``` <script> require(['hdjs'], function (hdjs) { hdjs.modal({ //加载的远程地址 content: ['http://localhost/hdjs/test', {name: '后盾网'}], title: '添加站点', width: 800 }); }); </script> ```