zoukankan      html  css  js  c++  java
  • sweetalert : 一个比较好看的弹出框

    1.引入

    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"> </script> 
    

    2.三个常用的提示框

    $(".demo_1").click(function() { 
        swal("这是一个信息提示框!"); 
    }); 
    $(".demo_2").click(function() { 
        swal("Good!", "弹出了一个操作成功的提示框", "success"); 
    }); 
    $(".demo_3").click(function() { 
        swal("OMG!", "弹出了一个错误提示框", "error"); 
    });
    

    3.警告框提示

    swal({ 
        title: "您确定要删除吗?", 
        text: "您确定要删除这条数据?", 
        type: "warning", 
        showCancelButton: true, 
        closeOnConfirm: false, 
        confirmButtonText: "是的,我要删除", 
        confirmButtonColor: "#ec6c62" 
    }, function() { 
        $.post(getUrl("Cart/del"), {id: id}, function(data) { 
            location.reload(); 
        }) 
    });
    

     

     

  • 相关阅读:
    C语言第四章
    C第三章,指代数据
    DES+MD5加密
    时间选择器
    百度地图定位
    Httputils请求网络数据
    xStream解析xml文件
    pulltorefresh
    slidingmenu的应用
    Duutils创建数据库
  • 原文地址:https://www.cnblogs.com/donghb/p/7543345.html
Copyright © 2011-2022 走看看