推荐一个 提示框 框架 SweetAlert

 
   
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>无标题文档</title>
  5. </head>
  6.   <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
  7. <script src="dist\sweetalert-dev.js"></script>  
  8. <link rel="stylesheet" href="dist\sweetalert.css">
  9. <script>
  10. $(function (){
  11. $("#div1").click(function() { 
  12.    swal("这是一个信息提示框!"); 
  13.   
  14. });
  15. });
  16. </script>
  17. <body>
  18. <div id="div1">测试1</div>
  19. </body>
  20. </html>
详细 参数
swal({ 
    title: "您确定要删除吗?", 
    text: "您确定要删除这条数据?", 
    type: "warning", 
    showCancelButton: true, 
    closeOnConfirm: false, 
    confirmButtonText: "是的,我要删除", 
    confirmButtonColor: "#ec6c62" 
}
API
参数 描述 默认值
title 提示框标题 -
text 提示内容 -
type 提示类型,有:success(成功),error(错误),warning(警告),input(输入)。 -
showCancelButton 是否显示“取消”按钮。 -
animation 提示框弹出时的动画效果,如slide-from-top(从顶部滑下)等 -
html 是否支持html内容。 -
timer 设置自动关闭提示框时间(毫秒)。 -
showConfirmButton 是否显示确定按钮。 -
confirmButtonText 定义确定按钮文本内容。 -
imageUrl 定义弹出框中的图片地址。

猜你喜欢

转载自blog.csdn.net/a1ccwt/article/details/53219469