使用简单模式 OSX 样式对话框进行多次调用 [英] Multiple calls with Simple Modal OSX Style Dialog

查看:21
本文介绍了使用简单模式 OSX 样式对话框进行多次调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 OSX 风格版本的 Simple Modal.我对模态有两个调用,因此有两个版本的内容.单击任一按钮时,它仅选择第一批内容.

I am using Simple Modal, the OSX style version. I have two calls to the modal and therefore two versions of content. When either of the buttons is clicked it selects only the first lot of content.

没有任何地方可以像大多数模式窗口一样对内容进行挂钩,因为页面上没有用于添加参数的 javascript...只有一个外部 .js 文件,出于明显的原因我不想触摸它.

There is nowhere to put a hook on the content like most modal windows as there is no javascript on the page to add parameters... only an external .js file which I don't want to touch for obvious reasons.

谁能帮我解决这个问题?

Can anyone help me with this problem?

推荐答案

我在我正在构建的网站上做了同样的事情.我只是为每个模态创建了不同的内容,并给每个模态一个唯一的 ID.所以我的内容看起来像:

I did the same thing on a site I'm building. I just created different content for each modal and gave each one a unique ID. So my content looked something like:

<a id='help'>HELP CONTENT</a>
<a id='about'>ABOUT CONTENT</a>
<a id='options'>OPTIONS CONTENT</a>

<div id='modal_help'>HELP CONTENT</div>
<div id='modal_about'>ABOUT CONTENT</div>
<div id='modal_options'>OPTIONS CONTENT</div>

然后在我的 JS 中,我有:

Then in my JS, I have:

$('a').click(function (e) {
    e.preventDefault();

    $('#modal_' + this.id).modal({OPTIONS});
});

希望对您有所帮助.

这篇关于使用简单模式 OSX 样式对话框进行多次调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆