关闭 jqModal 对话框而不在输入按钮的类属性中设置 jqmClose-tag
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
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
您正在寻找的类是
closeClass
- 但这仅适用于图像。显示对话框时,CSS 类为closeClass
的元素将在单击时关闭对话框。例如;如果您的对话框中已放入以下 html:
当单击该*图像*时,对话框将关闭。
您可以使用:
手动关闭对话框。即,如果您的 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 ofcloseClass
will close the dialog when clicked.For instance; If your with your dialog you have put the following html inside:
the dialog will close when that*image is clicked*.
You can use:
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.