关闭 jqModal 对话框而不在输入按钮的类属性中设置 jqmClose-tag

发布于 2025-01-03 11:07:22 字数 400 浏览 2 评论 0原文

我在 ASP.net MVC 3 项目中使用 jqModal。我有一些按钮,我在它们上应用 CSS 样式,但我读到输入元素的 class 属性可用于关闭 jqModal-dialogs。

这是一个代码示例,其中 jqModal 的 jqmClose 函数在输入元素的 class 属性中定义:

<input class="jqmClose" type="button" onclick="DeleteItem()" value='Bevestig' />

Is there another way to use the class-attribute for CSS-styling and close the jqModal-dialog without using jqmClose?

I'm using jqModal in my ASP.net MVC 3 project. I have some buttons where I apply CSS-styling on them but I've read that the class attribute of an input element can be used to close jqModal-dialogs.

This is an example of a code where jqModal's jqmClose-function is defined in the class attribute of the input-element:

<input class="jqmClose" type="button" onclick="DeleteItem()" value='Bevestig' />

Is there another way to use the class-attribute for CSS-styling and close the jqModal-dialog without using jqmClose?

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

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

发布评论

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

评论(2

颜漓半夏 2025-01-10 11:07:22

使用jqmHide方法关闭对话框:$('#my-dialog').jqmHide();

此外,您的输入有两个类属性。

http://dev.iceburg.net/jquery/jqModal/#how

Use the jqmHide method to close a dialog: $('#my-dialog').jqmHide();

Also, your input has two class attributes.

http://dev.iceburg.net/jquery/jqModal/#how

一萌ing 2025-01-10 11:07:22

您正在寻找的类是 closeClass - 但这仅适用于图像。显示对话框时,CSS 类为 closeClass 的元素将在单击时关闭对话框。

例如;如果您的对话框中已放入以下 ​​html:

<img class="closeClass" src="close.gif">

当单击该*图像*时,对话框将关闭。

您可以使用:

$(*'your-dialog-box-selector-here'*).jqmHide() 

手动关闭对话框。即,如果您的 div 的 id 是“jqmodal”,您可以输入 $("#jqmodal").jqmHide().

但对于 div 中带有上述类 closeClass 的图像,您无需进行编程手动进行。

希望这能回答您的问题。

The class you are looking for is closeClass - but this only works with images. When a dialog is shown, elements that have a CSS class of closeClass will close the dialog when clicked.

For instance; If your with your dialog you have put the following html inside:

<img class="closeClass" src="close.gif">

the dialog will close when that*image is clicked*.

You can use:

$(*'your-dialog-box-selector-here'*).jqmHide() 

to close a dialog manually. i.e. if your div's id is "jqmodal" you put $("#jqmodal").jqmHide().

But with the image with the class closeClass above within the div, you don't have to program it manually.

Hope this answers your question.

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