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

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

问题描述

我正在使用OSX样式版本的Simple Modal.我对模态有两个调用,因此对内容有两个版本.当单击两个按钮中的任何一个时,它仅选择第一批内容.

像大多数模态窗口一样,无处可钩住内容,因为页面上没有JavaScript可以添加参数...只是出于明显原因我不想触摸的外部.js文件. /p>

有人可以帮助我解决这个问题吗?

解决方案

我在正在构建的网站上做了同样的事情.我只是为每种模式创建了不同的内容,并为每个模式赋予了唯一的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 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?

解决方案

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.

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

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