首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jQuery SimpleModal插件-打开onLoad

jQuery SimpleModal插件-打开onLoad
EN

Stack Overflow用户
提问于 2010-12-20 07:26:47
回答 3查看 6.2K关注 0票数 1

我想使用SimpleModal Confirm Override功能并对其进行修改,以便激活页面的onLoad。

有没有人能帮忙?

SimpleModal演示页网站的Link

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2010-12-31 05:29:50

打开confirm.js并更改:

代码语言:javascript
复制
jQuery(function ($) {
    $('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
        e.preventDefault();

        // example of calling the confirm function
        // you must use a callback function to perform the "yes" action
        confirm("Continue to the SimpleModal Project page?", function () {
            window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/';
        });
    });
});

至:

代码语言:javascript
复制
jQuery(function ($) {
    // example of calling the confirm function
    // you must use a callback function to perform the "yes" action
    confirm("Continue to the SimpleModal Project page?", function () {
        window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/';
    });
});
票数 0
EN

Stack Overflow用户

发布于 2010-12-20 07:36:33

这将在页面加载时显示模式对话框...

代码语言:javascript
复制
$(document).ready(function() { 
    $('#basicModalContent').modal();
});
票数 3
EN

Stack Overflow用户

发布于 2014-12-05 19:46:23

打开osx.js并删除以下行(代码从第14行开始)

代码语言:javascript
复制
        init: function () {
        ****$("input.osx, a.osx").click(function (e) { << delete this line
            e.preventDefault();**** << delete this line

            $("#osx-modal-content").modal({
                overlayId: 'osx-overlay',
                containerId: 'osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });
        }); <<< delete this line
    },

成为

代码语言:javascript
复制
        init: function () {

            $("#osx-modal-content").modal({
                overlayId: 'osx-overlay',
                containerId: 'osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });

    },
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4485748

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档