素材网 素材网

jQuery简洁风格对话框提示插件Dialogbox

下载资源()次

阅读次数()次

发布时间:2015-03-28

jQuery简洁风格对话框提示插件Dialogbox
分享到:

用法简介:

来源:xw素材网

jQuery简洁风格对话框提示插件Dialogbox。
文件引用:

<script src="jquery.js"></script>
<script src="jquery.dialogbox-1.0.js"></script>
<script>
    $(document).ready(function(){
        //*********************************************************************************
        // Normal Message
        $("#normal").click(function() {
            $('body').dialogbox({type:"normal",title:"Message",message:"xw素材网 - www.xwcms.net"});
        });
        // Success Message
        $("#success").click(function() {
            $('body').dialogbox({type:"success",title:"Success",message:"xw素材网 - www.xwcms.net"});
        });
        // Warning Message
        $("#warning").click(function() {
            $('body').dialogbox({type:"warning",title:"Warning",message:"It's a warning!"});
        });
        // Error Message
        $("#error").click(function() {
            $('body').dialogbox({type:"error",title:"Error",message:"It's an error!"});
        });
        //*********************************************************************************
        // Yes/No Question
        $("#yes_no").click(function() {
            $('body').dialogbox({type:"yes/no",title:"Yes No Question",message:"Your question..."},function($btn){
                if($btn == "yes") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Yes"});
                }
                else if($btn == "no") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: No"});
                }
                else if($btn == "close") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Close"});
                }
            });
        });
        // OK/Cancel Question
        $("#ok_cancel").click(function() {
            $('body').dialogbox({type:"ok/cancel",title:"OK Cancel Question",message:"Your question..."},function($btn){
                if($btn == "ok") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Ok"});
                }
                else if($btn == "cancel") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Cancel"});
                }
                else if($btn == "close") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Close"});
                }
            });
        });
        // Retry/Ignore/Abort Question
        $("#retry_ignore_abort").click(function() {
            $('body').dialogbox({type:"retry/ignore/abort",title:"Retry Ignore Abort Question",message:"Your question..."},function($btn){
                if($btn == "retry") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Retry"});
                }
                else if($btn == "ignore") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Ignore"});
                }
                else if($btn == "abort") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Abort"});
                }
                else if($btn == "close") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Close"});
                }
            });
        });
        //*********************************************************************************
        // Text Prompt
        $("#text").click(function() {
            $('body').dialogbox({type:"text",title:"Text Prompt",message:"Your question..."},function($btn,$ans){
                if($btn == "close") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Close"});
                }
                else if($btn == "ok") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You entered: " + $ans});
                }
            });
        });
        // Select Prompt
        $("#select").click(function() {
            $('body').dialogbox({type:"select",title:"Text Prompt",message:"Your question...",options:"Opt1,Opt2,Opt3"},function($btn,$ans){
                if($btn == "close") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You pressed: Close"});
                }
                else if($btn == "ok") {
                    $('body').dialogbox({type:"normal",title:"Result",message:"You entered: " + $ans});
                }
            });
        });
    });
</script>


   

相关标签:

网友评论:

评论

发表 剩余字数:20

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

@ 2013 xwcms.net . All Rights Reserved. xw素材网 | 备案号:晋ICP备13005902号 联系管理员
×

邮箱订阅

什么是邮箱订阅?

邮箱订阅是xw素材网为jquery爱好者与web程序员提供一项以邮箱的方式发送最新jquery资源与素材资源的模式,用户只需在左侧填写正确的邮箱用户名与邮箱地址我们将每天推荐最新优质资源到用户邮箱。当然每份邮箱都会有一个取消订阅按钮,当用户点击取消按钮时我们将会停止对用户发送邮箱资源推送。再次感谢大家对xw素材网的支持与关注。