## 模態框
模態框使用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>
```
- 文檔已經遷移到后盾人
- 基礎知識
- 項目介紹
- 安裝配置
- 日期時間
- 日期選擇
- 列表框日期
- 日期區間
- 時間選擇
- moment
- 上傳處理
- 初始配置
- 圖片上傳
- 文件上傳
- 消息通知
- 消息通知
- Bootstrap消息
- izitoast
- SweetAlert
- 模態框
- 表單管理
- 異步請求
- 表單提交
- 表單驗證
- 擴展組件
- GET參數
- 剪貼板
- 表情選擇
- 圖表
- 拾色器
- 二維碼生成
- 光標控制
- 數據驗證
- md5
- 設備檢測
- Loading
- 預覽圖片
- 圖標庫
- COOKIE
- 百度地圖
- 城市選擇
- Vue.js
- jQuery
- axios
- 播放器
- 幻燈片
- 代碼高亮
- 阿里云OSS
- 驗證碼
- 頁面滾動
- lodash
- momentjs
- markdownIt
- 元素頁面固定
- 編輯器
- ueditor
- editor.md
- SimpleMDE
- simditor
- 自定義組件
- 1.0(舊版)
- 基礎知識
- 作者向軍
- 安裝配置
- 查看效果
- 元素樣式
- 日期時間
- 日期選擇
- 日期區間
- 時間選擇
- moment
- 上傳處理
- 圖片上傳
- 文件上傳
- 后臺處理
- 模態消息
- 模態
- notify
- bootstrap
- 表單管理
- 表單提交
- 表單驗證
- 表單樣式
- 擴展組件
- 自定義組件
- get參數
- 剪貼板
- 表情選擇
- 圖表
- 拾色器
- 二維碼生成
- 光標控制
- 數據驗證
- MD5
- loading
- 預覽圖片
- 圖標庫
- COOKIE
- 百度地圖
- 城市選擇
- Vuejs
- jQuery
- 播放器
- 幻燈片
- axios
- 代碼高亮
- 阿里云OSS
- 驗證碼
- 正則表達式
- 工具函數
- 編輯器
- 百度編輯器
- markdown
- simplemde-markdow