jquery带多种模式的弹出层提示框插件

所属分类: 网页特效-弹出层    2023-11-09 12:02:12

jquery带多种模式的弹出层提示框插件 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery带多种模式的弹出层提示框插件(共5个文件)

    • index.html

使用方法

/******************************************
 *
 *   Modalbox v1.2 - jQuery
 *
 ******************************************/
(function ($) {
    let pluginName = 'myOwnDialog';

    let d = 0;

    let initModal=function(data){
        let modal_box = "rest";
        let modal_x = 0;
        let modal_y = 0;
        let modal_box_left = 0;
        let modal_box_top = 0;
        let modal_box_width = 0;
        let modal_box_height = 0;
        let modal_box_new_left = 0;
        let modal_box_new_top = 0;

        let modal_box_bottom_from_top = 0;
        let modal_box_bottom_dust = 0;

        let modal_box_right_from_left = 0;
        let modal_box_right_dust = 0;

        let modal_box_top_dust = 0;
        let modal_box_bottom_fixed = 0;

        let modal_box_left_dust = 0;
        let modal_box_right_fixed = 0;

        let dialog_id = $(this).attr("data-dialogId");
        let dialog_resize = $(this).attr("data-dialogResizable");
        let dialog_move = $(this).attr("data-dialogMovable");
        let dialog_touch_outside_close = $(this).attr("data-dialogTouchOutsideForClose");
        let dialog_paddingDefault=4*2;
        let dialog_header_height=$(this).find('.titlebar').outerHeight()+dialog_paddingDefault;
        let dialog_resizing_height=0;
        let dialog_resizing_height_tmp=0;
        let dialog_header_width=142;
        let dialog_resizing_width=0;
        let dialog_resizing_width_tmp=0;

        let $moDialog = $(this);

        function closeModal(){
            let $modalOverlay=$(".myOwnDialog_overlay"+dialog_id);
            if(typeof data.settings.beforeCloseCallback==="function")
            {
                if(data.settings.beforeCloseCallback)
                {
                    data.settings.beforeCloseCallback();
                    $(".myOwnDialog_overlay" + dialog_id).css(
                        {
                            "display": "none"
                        });
                    $modalOverlay.remove();
                    $moDialog.fadeOut('400',function(){
                        if(typeof data.settings.afterClosedCallback==="function")
                        {
                            if(data.settings.afterClosedCallback)
                            {
                                data.settings.afterClosedCallback();
                            }
                        }
                    });

                }
            }
            else{
                $moDialog.fadeOut();
                $(".myOwnDialog_overlay" + dialog_id).css(
                    {
                        "display": "none"
                    });
                $modalOverlay.remove();
            }
        }

        if (dialog_touch_outside_close === "true") {
            $(document).on("mouseup",function (e) {
                if (modal_box==="rest" && !$moDialog.is(e.target) && $moDialog.has(e.target).length === 0) {
                    closeModal();
                }
            });
        }

        $(this).find(".close").on("click", function () {
            closeModal();
        });

        if (dialog_move === "true") {
            $(this).find(".titlebar_left").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;
                }
                modal_box = "move";
            });
        }
        if (dialog_resize === "true") {
            $(this).find(".mdl_bottom").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_bottom_from_top = modal_box_top + modal_box_height;
                    modal_box_bottom_dust = modal_box_bottom_from_top - modal_y;

                }
                modal_box = "bottom_resize";
            });
            $(this).find(".mdl_right").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_right_from_left = modal_box_left + modal_box_width;
                    modal_box_right_dust = modal_box_right_from_left - modal_x;

                }
                modal_box = "right_resize";
            });
            $(this).find(".mdl_bottom_right").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_bottom_from_top = modal_box_top + modal_box_height;
                    modal_box_bottom_dust = modal_box_bottom_from_top - modal_y;
                    modal_box_right_from_left = modal_box_left + modal_box_width;
                    modal_box_right_dust = modal_box_right_from_left - modal_x;

                }
                modal_box = "bottom_right_resize";
            });
            $(this).find(".mdl_top").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_top_dust = modal_box_new_top;
                    modal_box_bottom_fixed = modal_box_top + modal_box_height;
                }
                modal_box = "top_resize";
            });
            $(this).find(".mdl_left").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_left_dust = modal_box_new_left;
                    modal_box_right_fixed = modal_box_left + modal_box_width;
                }
                modal_box = "left_resize";
            });
            $(this).find(".mdl_top_left").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_left_dust = modal_box_new_left;
                    modal_box_right_fixed = modal_box_left + modal_box_width;
                    modal_box_top_dust = modal_box_new_top;
                    modal_box_bottom_fixed = modal_box_top + modal_box_height;
                }
                modal_box = "top_left_resize";
            });
            $(this).find(".mdl_top_right").on("mousedown",function (e) {
                if (modal_box === "rest") {
                    modal_x = e.pageX;
                    modal_y = e.pageY;
                    modal_box_left = $moDialog.position().left;
                    modal_box_top = $moDialog.position().top;
                    modal_box_width = $moDialog.width();
                    modal_box_height = $moDialog.height();
                    modal_box_new_left = e.pageX - modal_box_left;
                    modal_box_new_top = e.pageY - modal_box_top;

                    modal_box_right_from_left = modal_box_left + modal_box_width;
                    modal_box_right_dust = modal_box_right_from_left - modal_x;
                    modal_box_top_dust = modal_box_new_top;
                    modal_box_bottom_fixed = modal_box_top + modal_box_height;
                }
                modal_box = "top_right_resize";
            });
            $(this).find(".mdl_bottom_left").on("mousedown",function (e) {
                if (mo

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

jquery响应式支持嵌套的弹出框插件

一款自定义弹出层插件,点击按钮可触发显示弹出框,支持自定义设置:弹出框标题、弹出框高度、弹出框宽度、可选择是否显示标题栏。
  弹出层
 6240  0

jquery响应式带模糊搜索的多国语言选择器插件

一款响应式弹出层语言选择器,支持快速模糊查询点击选中即可关闭弹窗。
  弹出层
 7282  0

jquery鼠标悬停table单元格可修改字体/背景颜色插件

一款table单元格颜色编辑插件,在悬停表格单元格时显示一个颜色选择器弹出窗口,点击更改表格文本文字颜色和单元格背景颜色。
  弹出层
 210  0

jquery轻量级通知提示插件

一款超级小的通知提示插件,提供了5个主题:默认、成功、暗黑、危险和警告,还可以自定义主题或添加自己的主题。
  弹出层
 9192  0

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

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