I use the position parameter in the jQuery dialog plugin . I am trying to figure out how to get only the "top" and "left" values from this position object. However, it is difficult for me to understand this. Right now I have a dialog defined as follows:
<a href="#" onclick="showHelp();">help</a>
<div id="helpDialog" title="Help">
Some Help related text
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#helpDialog").dialog({
autoOpen: false,
modal: true,
buttons: {
'OK': function() {
$(this).dialog('close');
}
}
});
});
function showHelp() {
$("#helpDialog").dialog("open");
var p = ("#helpDialog").dialog( "option", "position" );
alert( );
}
</script>
When this dialog box opens, I want to display the "top" and "left" position of the dialog box in the warning window. But I can’t understand. Can someone show me? Thank!
source
share