基本上这是我的代码:
$("#EMIDetails").dialog({
resizable: false,
modal: false,
autoOpen: false,
position: 'absolute',
draggable: true,
show: {
effect: "fade",
},
buttons: {
},
close: function (ev, ui) {
$(this).dialog("close");
}
});
this.OpenEMIDetails = function () {
$("#EMIDetails").dialog("open");
return false;
}
this.CloseEMIDetails = function () {
$("#EMIDetails").dialog("close");
return false;
}
onclick =""objHandleExpressCheckout.OpenEMIDetails()"" >Know more " & keyValue.Key.ToString & "
此对话框位于中心。我希望它通过点击该链接以及链接位置下方打开它。
任何建议??
答案 0 :(得分:1)
阅读jQuery dialog position option
将onclick
更改为:
onclick =""objHandleExpressCheckout.OpenEMIDetails(this)"" >Know more " & keyValue.Key.ToString & "
获取当前点击链接的 this
参数。
function OpenEMIDetails(obj) {
$("#EMIDetails").dialog({
resizable: false,
modal: false,
autoOpen: false,
draggable: true,
show: {
effect: "fade",
},
buttons: {
},
close: function (ev, ui) {
$(this).dialog("close");
},
position: { my: "left top", at: "left bottom", of: $(obj) }
});
....
of
可以是:Selector或Element或jQuery或Event
阅读有关jQuery位置的更多信息:http://api.jqueryui.com/position/