【发布时间】:2018-07-22 05:09:34
【问题描述】:
我正在尝试使用 jquery ui 模态,但它不能满足我的需要,即,我只想在模态中显示数据,但在我单击按钮之前它会显示在这里。
function pop_up()
{
var dialog, form
dialog = $('div#infoDialog').dialog({
autoOpen: false,
height: 600,
width: 500,
modal: true
});
$('#showInfos').click(function(e){
e.preventDefault();
dialog.dialog('open');
});
}
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<button type="button" id="showInfos" onclick="pop_up();">test</button>
<div id="infoDialog" title="Eventinfos">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
</p>
</div>
【问题讨论】:
-
autoOpen: true,应该是:autoOpen: false,吗?否则它会在加载后立即打开。 -
没有变化。同样的问题
标签: javascript jquery jquery-ui jquery-ui-dialog