好用的模態框插件:jQuery-Confirm.js


jQuery-confirm.js 模態框插件教程 官網:http://craftpip.github.io/jquery-confirm/

jquery-confirm使用方法參考鏈接 :https://www.cnblogs.com/4job/p/10669922.html

速記用法

簡寫thing接受兩個字符串參數,第一個是對話框的內容,第二個是對話框的標題。第二個參數是可選的。

  1. $.alert('Content here', 'Title here'); try me
  2. $.confirm('A message', 'Title is optional'); try me
  3. $.dialog('Just to let you know'); try me

 

    function modalDelete(val){
        $.confirm({
            title: "提示",//默認值'Hello'
            content: "確定要刪除嗎?",
            //keyboardEnabled: true,//設置快捷鍵
            //enterKeys: 'confirm', // ENTER key
            buttons: {
                cancelButtonClass:     'btn-default',
                確定: {
                    btnClass: 'btn-blue',
                    action:function(){
                        dele(val);
                    }},
                取消: function(){
                        console.log('取消了刪除');
                }
            }
        });
    }

$.alert({
                title: '提示',
                content: '刪除成功!',
                closeIcon: true,//右上角關閉小叉
                autoClose: '關閉|500',
                buttons: {
                    關閉: function () {
                        console.log('自動關閉');
                    }
                }
            });

 

//不帶按鈕的彈出框
            var jc =  $.dialog({
                title: '提示',
                content: "刪除成功!"
            });
            var t1 = window.setTimeout(function() {
                jc.close();//關閉對話框
                //console.log('1秒鍾之后執行了')
            },1000)

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM