jQuery实现摸拟alert提示框
2019/6/27 22:24:36
本文主要是介绍jQuery实现摸拟alert提示框,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
页面调用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
这篇关于jQuery实现摸拟alert提示框的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-24Vue CLI多环境配置学习:从入门到实践
- 2024-11-24Vue CLI多环境配置学习:新手入门教程
- 2024-11-24Vue CLI学习:初学者指南
- 2024-11-24Vue CLI学习:从入门到上手的简单教程
- 2024-11-24Vue3+Vite学习:从零开始的前端开发之旅
- 2024-11-24Vue3阿里系UI组件学习入门教程
- 2024-11-24Vue3的阿里系UI组件学习入门指南
- 2024-11-24Vue3公共组件学习:新手入门教程
- 2024-11-24Vue3公共组件学习入门指南
- 2024-11-24vue3核心功能响应式变量学习