jQuery手机移动端弹窗提示插件,封装弹窗,有3种弹窗效果。
js代码
<script src="./js/jquery.tips-1.0.2.js"></script>
<script type="text/javascript">
let tips = new ShenTips();
let btn = $(".btn"),
btn2 = $('.btn2'),
btn3 = $('.btn3');
btn.on('click', function() {
tips.tips({
msg: "你今天是否比昨天更帅了呢",
time: 300
});
});
btn2.on('click', function() {
tips.alert({
title: "提示", // 默认值:"提示",非必填
msg: "你今天是否比昨天更帅了呢", // 默认值:""
time: 500, // 默认值:500,非必填
options: ["是的呢"], // 默认值:['确认'],非必填
confirm: function() { // 默认值:"",非必填
console.log("我确实比昨天更帅了");
}
})
});
btn3.on('click', function() {
tips.confirm({
title: "请确认", // 默认值:"提示",非必填
msg: "是否提交试卷", // 默认值:""
options: ["继续答题", "提交试卷"], // 默认值:['取消', '确认'],非必填
time: 500, // 默认值:500,非必填
close: false, // 默认值:false,非必填 说明:如果为true,点击确认,关闭该弹窗。
cancel() { // 默认值:"",非必填
console.log("点击了取消按钮");
},
confirm() { // 默认值:"",非必填
console.log("点击了确认按钮");
tips.close(); // 确认后关闭该弹窗
}
})
});
</script>
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791