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

jquery网页右下角弹出在线客服窗口插件

一款固定于页面右下角的网站客服弹出层,可设置在线图标状态,绿色清爽实用。
  弹出层
 272  

jquery轻量级鼠标悬停文字工具提示插件

一款可自定义的文本文字工具提示插件,鼠标悬停于元素上触发文字提示特效,可引导用户对某个功能模块的说明。
  弹出层
 252  

jquery带进度条可自定义的消息通知插件

一款带倒计时进度条的通知插件,可自定义设置在左侧或右侧顶部显示及背景色,带进度条和关闭按钮。
  弹出层
 320  

jquery简单轻量级自定义弹窗插件

一款html5弹出层插件,支持自定义参数:皮肤样式、内容、按钮文字。
  弹出层
 314  

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

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