简体   繁体   English

如何在不使用对话框的情况下创建看起来像jQuery对话框的div?

[英]How can I create a div that looks like a jQuery dialog without using a dialog?

I am using knouckout js to write a wizard like interface. 我正在使用knouckout js编写类似界面的向导。 The system is working well, except that I need to have each page/step appear in a dialog. 系统运行良好,除了我需要在对话框中显示每个页面/步骤。 The jQuery dialog is used elsewhere in the system, and has the styling that is needed, buttons, etc. jQuery对话框在系统的其他地方使用,并具有所需的样式,按钮等。

The intent is to have the data template bound to that div (or be able to change the content of the div) without calling dialog(). 目的是使数据模板绑定到该div(或能够更改div的内容)而无需调用dialog()。 The reason is that it is a hassle to get MVVM working with methods in this style. 原因是让MVVM使用这种样式的方法很麻烦。

Is there a good way to do this? 有什么好方法吗?

Thanks, Erick 谢谢,埃里克

you can use jquery ui classes on regular elements to get the jquery ui styles. 您可以在常规元素上使用jquery ui类来获取jquery ui样式。

<div class="ui-widget ui-widget-content ui-corner-all">
  <div class="ui-widget-header ui-corner-all">
    <span id="ui-dialog-title-dialog" class="ui-dialog-title">Panel title</span>
      <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
   </div>
   <div style="height: 200px; min-height: 109px; width: auto;" class="ui-widget-content">
      <p>panel content goes here.</p>
   </div>
</div>

it wont be draggable or resizeable and the close button won't work or rollover without you adding those behaviors manually 如果您不手动添加这些行为,则该按钮将不可拖动或调整大小,并且关闭按钮将不起作用或无法翻转

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM