<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      sweetalert api文檔

      官網和下載地址: http://t4t5.github.io/sweetalert/

      基本使用:

      • 基本消息消息彈窗

        swal("Here's a message!")
      • 下面有文字的標題彈窗

        swal("Here's a message!", "It's pretty, isn't it?")
      • 一個成功的消息彈窗

        swal("Good job!", "You clicked the button!", "success")
      • 一個警告消息,其功能附加到“確認”按鈕的彈窗

        swal({
          title: "Are you sure?",
          text: "You will not be able to recover this imaginary file!",
          type: "warning",
          showCancelButton: true,
          confirmButtonColor: "#DD6B55",
          confirmButtonText: "Yes, delete it!",
          closeOnConfirm: false
        },
        function(){
          swal("Deleted!", "Your imaginary file has been deleted.", "success");
        });
      • 并通過傳遞一個參數,你可以執行別的“取消”

        swal({
          title: "Are you sure?",
          text: "You will not be able to recover this imaginary file!",
          type: "warning",
          showCancelButton: true,
          confirmButtonColor: "#DD6B55",
          confirmButtonText: "Yes, delete it!",
          cancelButtonText: "No, cancel plx!",
          closeOnConfirm: false,
          closeOnCancel: false
        },
        function(isConfirm){
          if (isConfirm) {
            swal("Deleted!", "Your imaginary file has been deleted.", "success");
          } else {
            swal("Cancelled", "Your imaginary file is safe :)", "error");
          }
        });
      • 帶有自定義圖標

        swal({
          title: "Sweet!",
          text: "Here's a custom image.",
          imageUrl: "images/thumbs-up.jpg"
        });
      • 自定義HTML消息

        swal({
          title: "HTML <small>Title</small>!",
          text: "A custom <span style="color:#F8BB86">html<span> message.",
          html: true
        });
      • 帶有自動關閉計時器的消息的彈窗

        swal({
          title: "Auto close alert!",
          text: "I will close in 2 seconds.",
          timer: 2000,
          showConfirmButton: false
        });
      • 替換“提示”功能

        swal({
          title: "An input!",
          text: "Write something interesting:",
          type: "input",
          showCancelButton: true,
          closeOnConfirm: false,
          animation: "slide-from-top",
          inputPlaceholder: "Write something"
        },
        function(inputValue){
          if (inputValue === false) return false;
          
          if (inputValue === "") {
            swal.showInputError("You need to write something!");
            return false
          }
          
          swal("Nice!", "You wrote: " + inputValue, "success");
        });
      • 使用加載器(例如AJAX請求)

        swal({
          title: "Ajax request example",
          text: "Submit to run ajax request",
          type: "info",
          showCancelButton: true,
          closeOnConfirm: false,
          showLoaderOnConfirm: true,
        },
        function(){
          setTimeout(function(){
            swal("Ajax request finished!");
          }, 2000);
        });
      • 你也可以改變SweetAlert的主題css

        <link rel="stylesheet" type="text/css"href="dist/sweetalert.css">
        <link rel="stylesheet" type="text/css"href="themes/twitter.css">

      安裝

      1. 通過引用必要的文件來初始化插件:

        <script src="dist/sweetalert.min.js"></script>
        <link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
      2. 頁面加載后調用SweetAlert函數

        swal({
          title: "Error!",
          text: "Here's my error message!",
          type: "error",
          confirmButtonText: "Cool"
        });

       

       

      配置

      這里是你可以使用的鍵,如果你傳遞一個對象到sweetAlert:

      modal中文翻譯是模態框 ,次文檔為了理解容易,現在統一翻譯為動態彈出框

       
      參數
      默認值
       
      說明描述
      title null (required) 動態彈出框的標題。 它可以添加到鍵“title”下的對象,也可以作為函數的第一個參數傳遞
      text null 動態彈出框的描述。 它可以被添加到鍵“文本”下的對象或作為函數的第二個參數傳遞
      type null 動態彈出框的類型。 SweetAlert自帶4種內置類型,會顯示相應的圖標動畫:“warning”,“error”,“success”和“info”。 您也可以將其設置為“輸入”以獲得提示模態。 它可以放在鍵“類型”下的對象中,也可以作為函數的第三個參數傳遞
      allowEscapeKey true 如果設置為true,用戶可以通過按退出鍵退出動態彈出框
      customClass null 模態的自定義CSS類。 它可以添加到對象的鍵“自定義類”下
      allowOutsideClick false 如果設置為true,用戶可以通過點擊模態來關閉動態彈出框
      showCancelButton false 如果設置為true,將顯示一個“取消”按鈕,用戶可以單擊該按鈕來關閉動態彈出框
      showConfirmButton true 如果設置為false,“確定/確認”按鈕將被隱藏。 確保您設置一個計時器或設置允許外點擊為true時使用此,以免引起用戶的煩惱
      confirmButtonText "OK" 使用此按鈕可以更改“確認”按鈕上的文本。 如果showsCancelButton設置為true,確認按鈕將自動顯示“Confirm”,而不是“OK”
      confirmButtonColor "#AEDEF4" 使用此選項可更改“確認”按鈕的背景顏色(必須為十六進制值)
      cancelButtonText "Cancel" 使用此按鈕可以更改“取消”按鈕上的文本
      closeOnConfirm true 如果您希望動態彈出框保持打開,即使用戶按下“確認”按鈕,設置為false。 如果附加到“確認”按鈕的功能是另一個SweetAlert,這是特別有用的
      closeOnCancel true 與關閉相同確認,但用于取消按鈕
      imageUrl null 為動態彈出框添加自定義圖標。 應包含帶有圖像路徑的字符串
      imageSize "80x80" 如果設置了imageUrl,您可以指定imageSize來描述圖標在px中的大小。 傳遞一個字符串,兩個值之間用“x”分隔。 第一個值是寬度,第二個值是高度
      timer null 動態彈出框的自動關閉定時器。 設置為ms(毫秒)。
      html false 如果設置為true,將不轉義標題和文本參數。 (如果您擔心XSS攻擊,請設置為false。)
      animation true 如果設置為false,動態彈出框動畫將被禁用。 可能的(字符串)值:pop(動畫設置為true時的默認值),從頂部滑動,從底部滑動
      inputType "text" 使用type:“input”時更改輸入字段的類型(如果您希望用戶輸入其密碼,這將非常有用)
      inputPlaceholder null 使用輸入類型時,可以指定一個占位符來幫助用戶
      inputValue null 指定在使用類型時希望輸入顯示的默認文本值:“input”
      showLoaderOnConfirm false 設置為true可禁用按鈕,并顯示正在加載某些內容

      方法舉例

      SweetAlert還提供了一些簡單的方法,你可以調用:
       
      方法
      例子
       
      方法說明
      setDefaults swal.setDefaults({ confirmButtonColor: '#0000' }); 如果你在調用SweetAlert時最終使用了很多相同的設置,你可以在程序的開始使用setDefaults來設置它們一次
      close swal.close(); 以編程方式關閉當前打開的SweetAlert
      showInputError swal.showInputError("Invalid email!"); 如果用戶的數據不正確,請在驗證輸入字段后顯示錯誤消息
      enableButtons, disableButtons swal.disableButtons(); 禁用或啟用用戶單擊取消和確認按鈕

       

      參考文章:

      http://t4t5.github.io/sweetalert/

      http://www.rzrgm.cn/zx-admin/p/6009558.html

      posted @ 2017-03-30 16:56  培杰  閱讀(3530)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 久久一区二区中文字幕| 国产高潮又爽又刺激的视频| 全国最大成人网| 国产精品久久久久无码av色戒 | 国产丰满乱子伦无码专区| 欧美老少配性行为| 午夜福利激情一区二区三区| 麻豆tv入口在线看| 国产精品老熟女露脸视频| 九九综合九色综合网站| 在线成人| 亚洲欧美日韩在线码| 亚洲欧美在线一区中文字幕| 日韩乱码人妻无码中文字幕视频 | 国产一级av在线播放| 99热这里有精品| 精品婷婷色一区二区三区| 日韩午夜午码高清福利片| 五月综合婷婷开心综合婷婷| 内地偷拍一区二区三区| 国产成人精品国内自产色| 欧美人与禽2o2o性论交| 久久久久久无码午夜精品直播| 久久精品国产亚洲av亚| 中文字幕日韩有码第一页| 亚洲中文字幕在线无码一区二区| 国产亚洲精品VA片在线播放| 亚洲精品日韩中文字幕| 欧美www在线观看| 欧美成本人视频免费播放| 精品素人AV无码不卡在线观看| 亚洲欧美人成网站在线观看看| 欧美黑人又粗又大久久久| 久久精品青青大伊人av| jizz视频在线观看| 国产精品人妻熟女男人的天堂| 视频一区视频二区制服丝袜| 日日爽日日操| 国产一区二区精品自拍| 欧美丰满熟妇xxxx性| 天堂va蜜桃一区二区三区|