实用的toast、loading等弹框插件
表单表格 3年前
3 3.14K 5
这是一款基于jQuery的toast、loading、模态对话框、操作菜单仿微信小程序插件。
使用方法
在页面引入以下jquery.min.js、alert.js文件
1 2 | <script src="js/jquery.min.js"></script> <script src="js/alert.js"></script> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | <script> $(".btn").on("click",function () { showToast({ title:"成功的哟!", icon:'success', duration:3000, mask:true, success:function (res) { console.warn(JSON.stringify(res)) } }); /*setTimeout(function(){ hideToast() },1000)*/ }); $(".btn1").on("click",function () { showLoading({ title:"测试测试测试,测试测试测试,测试测试测试", mask:true, success:function (res) { console.warn(JSON.stringify(res)) } }); setTimeout(function(){ hideLoading() },2000) }); $(".btn2").on("click",function () { showModal({ title:"提示", content:"asdasda", showCancel:true, cancelText:'no', cancelColor:"#ffffff", confirmText:'yes', confirmColor:'#ffffff', success:function (res) { if (res.confirm) { console.warn("User clicking determination" + JSON.stringify(res)); } else { console.warn("User clicking cancel" + JSON.stringify(res)); } } }); }); $(".btn3").on("click",function () { showActionSheet({ itemList: ['A', 'B', 'C',], itemColor:"#cccccc", success: function(res) { console.warn(JSON.stringify(res)) }, }); }); </script> |