联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

jQuery实现摸拟alert提示框 - Web前端

作者:98wpeu发布时间:2026-08-21分类:网页前端技术浏览:6


导读:页面调用JS:$(document).ready(function(){$("#delete_without_layer").click(functi...

页面调用JS:

    $(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");
        }});
      });
    });

figure 1. common confirm

Figure 2. confirm box with layer

Figure 3. error box

Figure 4. success box

Figure 5. warning box

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

标签:提示WebalertjQuery


网页前端技术排行
最近发表
网站分类
标签列表