使用简单模态 OSX 样式对话框进行多次调用

发布于 2024-08-19 05:08:52 字数 191 浏览 3 评论 0原文

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

像大多数模态窗口一样,没有地方可以在内容上放置钩子,因为页面上没有 JavaScript 来添加参数...只有一个外部 .js 文件,出于明显的原因,我不想触及该文件。

谁能帮我解决这个问题吗?

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼眸里的快感 2024-08-26 05:08:52

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

<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 中,我有:

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

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

希望有帮助。

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>

Then in my JS, I have:

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

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

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文