在现有 div 中包含 jquery ui 对话框
我有一个对话框,我想将其包装在 div 中,如下所示。
<div class="myClass">
<div id="dialog"></div>
</div>
我的所有 CSS 规则都将 .myClass 作为选择器中的父项:
.myclass .....
当我调用 JQuery 对话框时,
$( "#dialog" ).dialog({})
它会将 id=dialog div 作为其自己的 div 放置在我的标记底部,而不是放在 .我的班级分区。如何将对话框包装在 .myclass div 中?
I have a dialog that I want wrapped in a div like so.
<div class="myClass">
<div id="dialog"></div>
</div>
All of my CSS rules have .myClass as a parent in the selector:
.myclass .....
When I call my JQuery dialog
$( "#dialog" ).dialog({})
it places the id=dialog
div as its own div at the bottom of my tag, not inside the .myclass div. How can I wrap the dialog in a .myclass div?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,你不能那样做。让 jquery 做它的事情。你应该关注里面的内容。
反之亦然:
你可以随意修改里面的内容。至于外面的 ui,已经主题化的对话框,您应该简单地覆盖 css 规则。嗯,这是最简单的方法。
Yea, you can't do it that way. Let jquery do its thing. You should focus on the content inside.
How about the other way around:
You can modify the content inside as you wish. As far as the ui outside, the dialog box that has been themed you should simply overwrite the css rules. Well that is the easiest way.
你真的需要这样做吗?为什么不保留您的
dialog
id,并为其添加一个类呢?Do you really need to do that? Why don't you keep your
dialog
id, and just add a class to it as well?<div id="dialog" class="whatever"></div>