欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

写了个简单的摸拟alert\提示框,有需要可以拿去用.

程序员文章站 2022-05-31 18:04:47
...

写了个简单的摸拟alert\提示框,欢迎大家使用.

源码下载:https://github.com/tomlxq/jquery-confirm

效果图:

This is a demonstration. include fancybox css/js, please take care!

Example:

$(document).ready(function() {
        $("#delete_without_layer").click(function () {
            $.tConfirm.open({body:'Are you sure to delete?',type:'confirm',onOk:function(){
                alert("yes");
            }});
        });
        $("#delete_with_layer").click(function () {
            $.tConfirm.open({overlay:true,body:'Are you sure to delete?',type:'confirm',onOk:function(){
                alert("yes");
            }});
        });
        $("#information").click(function () {
            $.tConfirm.open({body:'This is confirm box based on fancybox!',type:'info',onOk:function(){
                alert("yes");
            }});
        });
        $("#success").click(function () {
            $.tConfirm.open({body:'Save success!',type:'success',onOk:function(){
                alert("yes");
            }});
        });
        $("#error").click(function () {
            $.tConfirm.open({body:'Some fields are wrong!',type:'error',onOk:function(){
                alert("yes");
            }});
        });      $("#warning").click(function () {
            $.tConfirm.open({body:'Someone login, it\'s not real user!',type:'warning',onOk:function(){
                alert("yes");
            }});
        });
    });
写了个简单的摸拟alert\提示框,有需要可以拿去用.
Figure 1. common confirm
写了个简单的摸拟alert\提示框,有需要可以拿去用.
Figure 2. confirm box with layer
写了个简单的摸拟alert\提示框,有需要可以拿去用.
Figure 3. error box
写了个简单的摸拟alert\提示框,有需要可以拿去用.
Figure 4. success box
写了个简单的摸拟alert\提示框,有需要可以拿去用.
Figure 5. warning box