jquery响应式支持自定义的提示框插件

所属分类: 网页特效-弹出层    2023-10-30 04:36:22

jquery响应式支持自定义的提示框插件 ie兼容6
反馈问题  查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery响应式支持自定义的提示框插件(共3个文件)

    • index.html

使用方法

    function simpleAlert(props = {}) {
        if (!window.jQuery) {  
            alert("Please Add Jquery Before this script")
            return;
        }
        if ($('.simple_alert_div').length != 0) {
            $(".simple_alert_div").remove();
        }
        // $(".simple_alert_div").hide('fast', 'swing', function () {
        //     $(".simple_alert_div").remove();
        // });
        let bg_color = props.bg_color
        let text = props.text
        let text_color = props.text_color
        let orientation = props.orientation
        let after_alert = props.after_alert
        $("body").append(`<div class="simple_alert_div" class="text-center py-2 text-white px-4 mx-auto">
        <span id="simple_alert_message"></span>
        </div>`)
        if (text_color) {
            $(".simple_alert_div").css('color', text_color)
        }
        if (!text) {
            text = "这是一条简单的通知提示内容"
        }
        if (bg_color) {
            $(".simple_alert_div").css('background-color', bg_color)
        }

        if (orientation) {
            if (orientation == "bl") {
                $(".simple_alert_div").css('bottom', '10px')
                $(".simple_alert_div").css('left', '10px')
            }
            if (orientation == "tl") {
                $(".simple_alert_div").css('top', '10px')
                $(".simple_alert_div").css('left', '10px')
            }
            if (orientation == "br") {
                $(".simple_alert_div").css('bottom', '10px')
                $(".simple_alert_div").css('right', '10px')
            }
            if (orientation == "tr") {
                $(".simple_alert_div").css('top', '10px')
                $(".simple_alert_div").css('right', '10px')
            }
        } else {
            $(".simple_alert_div").css('bottom', '10px')
            $(".simple_alert_div").css('right', '10px')
        }

        $("#simple_alert_message").html(`${text} <b class="snackbar_dismiss">好的</b>`)
        $(".snackbar_dismiss").click(() => {
            $(".simple_alert_div").hide('fast', 'swing', function () {
                if (after_alert) {
                    after_alert()
                }
                $(".simple_alert_div").remove();
            });
        })

    }

站长提示:
1. 平台上所有素材资源,需注册登录会员方能正常下载。
2. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励20K币
3. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
4. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 弹出层

jquery可点击关闭的图片弹出层提示插件

一款网页图片弹窗提示插件,访问页面自动弹出显示,可点击下方关闭按钮进行关闭隐藏。
  弹出层
 230  

html5响应式带自动关闭的消息提醒弹出层特效代码

一款自动关闭弹出层代码,自动弹出显示提示窗口,在自定义时间5秒钟后自动关闭提示窗口。
  弹出层
 157  

jquery响应式弹出cookie同意提示框插件

第一次访问网站页面时,此插件会在网站上显示cookie同意(数据收集策略)弹出窗口。
  弹出层
 667  

jquery轻量级链接提示工具插件

一款响应式的文字链接提示工具,鼠标悬停在链接上立即触发显示提示工具,非常实用。
  弹出层
 204  

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论