如何定位jquery ui窗口?
我尝试了位置,但对话框一直显示到右侧,我调整了数字,但显示没有变化:
$("#div_").dialog("wid").position({ position: [10, 50]});
END UPDATE
这是我的 html 代码,在下面呈现,
radio button1 sample
radio button2 sample
radio button3 sample
所以我想要的是:用户将鼠标悬停在“示例”上,显示链接下方的 jquery-ui,
它适用于第一个链接,但第二个链接显示在屏幕中间,即使我分配了 left, top
,有什么帮助吗?
$(document).ready(function () {
$('#div_').dialog({
autoOpen: false,
});
$(".radiobutton1").hover(
function (){
$('#div_').dialog({title: "Iamge Left)"});
$('#div_').removeClass("radiobutton1_1 radiobutton2").dialog('open');
var target = $(this);
$("#div_").dialog("wid").position({
my: 'left top',
at: 'center bottom',
of: target
});
},
function (){
$('#div_').dialog('close');
});
$(".radiobutton2").hover(
function (){
$('#div_').dialog({title: "Images Right"});
$('#div_').removeClass("radiobutton1_1 radiobutton2").addClass("radiobutton2").dialog('open');
var target = $(this);
$("#div_").dialog("wid").position({
my: 'center top'
at: 'center bottom',
of: target
});
},
function (){
$('#div_').dialog('close');
});
});
i tried with position but the dialog shows all the way to the right side and i tweak with numbers but no change in displaying:
$("#div_").dialog("wid").position({ position: [10, 50]});
END UPDATE
here is my html code that renders below
radio button1 sample
radio button2 sample
radio button3 sample
so what i want is: when the user hover over the "Sample" show the jquery-ui underneath the link
its working for the first link but the second link its showing in middle of the screen, even thoug i have left, top
assigned, any help?
$(document).ready(function () {
$('#div_').dialog({
autoOpen: false,
});
$(".radiobutton1").hover(
function (){
$('#div_').dialog({title: "Iamge Left)"});
$('#div_').removeClass("radiobutton1_1 radiobutton2").dialog('open');
var target = $(this);
$("#div_").dialog("wid").position({
my: 'left top',
at: 'center bottom',
of: target
});
},
function (){
$('#div_').dialog('close');
});
$(".radiobutton2").hover(
function (){
$('#div_').dialog({title: "Images Right"});
$('#div_').removeClass("radiobutton1_1 radiobutton2").addClass("radiobutton2").dialog('open');
var target = $(this);
$("#div_").dialog("wid").position({
my: 'center top'
at: 'center bottom',
of: target
});
},
function (){
$('#div_').dialog('close');
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,但第二次你有这个:
会是
Yeah but for the second you have this :
Would be