jQuery手机移动端弹窗提示插件

来源:https://www.sucaihuo.com/js/5236.html 2021-03-17 09:27浏览(641) 收藏

jQuery手机移动端弹窗提示插件,封装弹窗,有3种弹窗效果。
jQuery手机移动端弹窗提示插件
分类:悬浮层/弹出层 > 弹窗 难易:初级
查看演示 下载资源 下载积分: 20 积分

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>
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2