ui界面的测试用例(AmazeUI 模态窗口的实现代码)
类别:Web前端 浏览量:2716
时间:2021-10-20 08:36:04 ui界面的测试用例
AmazeUI 模态窗口的实现代码实现代码如下所示:
<!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>模态窗口</title> <link rel="stylesheet" href="assets/css/amazeui.min.css"> <!--[if (gte IE 9)|!(IE)]><!--> <script src="assets/js/jquery.min.js"></script> <!--<![endif]--> <!--[if lte IE 8 ]> <script src="assets/ie8/jquery.min.js"></script> <script src="assets/ie8/modernizr.js"></script> <script src="assets/js/amazeui.ie8polyfill.min.js"></script> <![endif]--> <script src="assets/js/amazeui.min.js"></script> </head> <body style="margin: 50px;"> <!--基本形式--> <button type="button" class="am-btn am-btn-primary" data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0, width: 400, height: 225}"> Modal </button> <li class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1"> <li class="am-modal-dialog"> <li class="am-modal-hd">Modal 标题 <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>×</a> </li> <li class="am-modal-bd"> Modal 内容。本 Modal 无法通过遮罩层关闭。 </li> </li> </li> <!--模拟 Alert--> <button type="button" class="am-btn am-btn-primary" data-am-modal="{target: '#my-alert'}"> Alert </button> <li class="am-modal am-modal-alert" tabindex="-1" id="my-alert"> <li class="am-modal-dialog"> <li class="am-modal-hd">Amaze UI</li> <li class="am-modal-bd"> Hello world! </li> <li class="am-modal-footer"> <span class="am-modal-btn">确定</span> </li> </li> </li> <!--模拟 Confirm--> <button type="button" class="am-btn am-btn-warning" id="doc-confirm-toggle"> Confirm </button> <ul class="am-list confirm-list" id="doc-modal-list"> <li><a data-id="1" href="#">每个人都有一道伤口, 或深或浅,盖上布,以为不存在。</a><i class="am-icon-close"></i></li> </ul> <li class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm"> <li class="am-modal-dialog"> <li class="am-modal-hd">Amaze UI</li> <li class="am-modal-bd"> 你,确定要删除这条记录吗? </li> <li class="am-modal-footer"> <span class="am-modal-btn" data-am-modal-cancel>取消</span> <span class="am-modal-btn" data-am-modal-confirm>确定</span> </li> </li> </li> <script> $(function() { $('#doc-modal-list').find('.am-icon-close').add('#doc-confirm-toggle'). on('click', function() { $('#my-confirm').modal({ relatedTarget: this, onConfirm: function(options) { var $link = $(this.relatedTarget).prev('a'); var msg = $link.length ? '你要删除的链接 ID 为 ' + $link.data('id') : '确定了,但不知道要整哪样'; alert(msg); }, // closeOnConfirm: false, onCancel: function() { alert('算求,不弄了'); } }); }); }); </script> <!--模拟 Prompt--> <button type="button" class="am-btn am-btn-success" id="doc-prompt-toggle"> Prompt </button> <li class="am-modal am-modal-prompt" tabindex="-1" id="my-prompt"> <li class="am-modal-dialog"> <li class="am-modal-hd">Amaze UI</li> <li class="am-modal-bd"> 来来来,吐槽点啥吧 <input type="text" class="am-modal-prompt-input"> </li> <li class="am-modal-footer"> <span class="am-modal-btn" data-am-modal-cancel>取消</span> <span class="am-modal-btn" data-am-modal-confirm>提交</span> </li> </li> </li> <script> $(function() { $('#doc-prompt-toggle').on('click', function() { $('#my-prompt').modal({ relatedTarget: this, onConfirm: function(e) { alert('你输入的是:' + e.data || '') }, onCancel: function(e) { alert('不想说!'); } }); }); }); </script> <!--Modal Loading--> <button type="button" class="am-btn am-btn-success" data-am-modal="{target: '#my-modal-loading'}"> Modal Loading </button> <li class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading"> <li class="am-modal-dialog"> <li class="am-modal-hd">正在载入...</li> <li class="am-modal-bd"> <span class="am-icon-spinner am-icon-spin"></span> </li> </li> </li> <!--Actions--> <button type="button" class="am-btn am-btn-secondary" data-am-modal="{target: '#my-actions'}"> Actions </button> <li class="am-modal-actions" id="my-actions"> <li class="am-modal-actions-group"> <ul class="am-list"> <li class="am-modal-actions-header">提示信息</li> <li><a href="#"><span class="am-icon-wechat"></span>微信</a></li> <li class="am-modal-actions-danger"> <a href="#"><i class="am-icon-twitter"></i>twitter</a> </li> </ul> </li> <li class="am-modal-actions-group"> <button class="am-btn am-btn-secondary am-btn-block" data-am-modal-close>取消</button> </li> </li> <!--Popup--> <button type="button" class="am-btn am-btn-danger" data-am-modal="{target: '#my-popup'}"> Popup </button> <li class="am-popup" id="my-popup"> <li class="am-popup-inner"> <li class="am-popup-hd"> <h4 class="am-popup-title">...</h4> <span data-am-modal-close class="am-close">×</span> </li> <li class="am-popup-bd"> ... </li> </li> </li> </body> </html>
效果图:
总结
到此这篇关于AmazeUI 模态窗口的实现代码的文章就介绍到这了,更多相关AmazeUI 模态窗口内容请搜索开心学习网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持开心学习网!
热门推荐
- mysql详细笔记(MySQL的内存表的基础学习教程)
- vue3.0安装element(vue3+electron12+dll开发客户端配置详解)
- TFS源代码管理
- php怎么引用文件(php引用和拷贝的区别知识点总结)
- pandas如何指定空数据类型(解决Pandas的DataFrame输出截断和省略的问题)
- dedecms添加底部链接(织梦dedecms调用得到文章所属的副栏目id及副栏目名称的教程)
- 宝塔面板怎么修改默认端口(如何修改宝塔Linux面板默认的端口号8888?)
- mouseover与mouseenter的区别
- 网站页面导航怎么设置css(纯CSS + 媒体查询实现网页导航效果)
- navicat连接mysql报1045(解决Navicat for MySQL 连接 MySQL 报2005错误的问题)