Search and Top Navigation
#10916 closed bug (notabug)
Opened January 30, 2015 12:58PM UTC
Closed January 30, 2015 01:41PM UTC
Last modified January 30, 2015 01:56PM UTC
jquery dialog position attribute not working. But It works in previouse versions.
| Reported by: | vergules | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | none |
| Component: | ui.dialog | Version: | 1.11.2 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<link type="text/css" rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/start/jquery-ui.css" />
<script type="text/javascript" src="//code.jquery.com/ui/1.11.2/jquery-ui.min.js"></script>
</head>
<body>
<form id="form1" action="TestDlg.htm">
<button id="btnShowDlg" onclick="showDialog()" type="button">Open</button>
</form>
<div id="dlgTest" style="display:none" title="Test">
Position attribute not working.
</div>
</body>
<script type="text/javascript">
function showDialog()
{
var dlg = $('#dlgTest');
dlg.dialog({
modal: false,
height: 200,
width: 400,
open: function(event, ui)
{
setPosition(dlg);
dlg.dialog("option", "appendTo", "#form1");
}
});
dlg.dialog("open");
return false;
}
function setPosition(dlg)
{
var thePosition =
{
my: "left top",
at: "left+100 top+30",
collision: "fit fit"
}
dlg.dialog({ position: thePosition });
}
</script>
</html>
Attachments (0)
Change History (2)
Changed January 30, 2015 01:41PM UTC by comment:1
| resolution: | → notabug |
|---|---|
| status: | new → closed |
Changed January 30, 2015 01:56PM UTC by comment:2
Actually, I see your real problem. You're only providing partial information. If you don't specify the of, then it has no idea how to position, so it does nothing.
You're mixing versions. You cannot use a 1.10.4 CSS theme with the 1.11.2 JS. If you continue having problems, please provide a reduced test case using jsbin or jsFiddle (as requested in the red box, so we can actually see it without having to copy paste a bunch of code).