admin管理员组文章数量:1388877
I am using JavaScript as a popup. But what I'd like it to do is load the popped up page in a certain area, Specified by say an X & Y coordinate.
My current code is :
function openwindow()
{
window.open("index.php?dll=gallery&sub=upload","mywindow","menubar=1,resizable=1,width=660px,height=390px");
}
Is this achievable and if so, How, based on the code I've supplied.
Thanks
I am using JavaScript as a popup. But what I'd like it to do is load the popped up page in a certain area, Specified by say an X & Y coordinate.
My current code is :
function openwindow()
{
window.open("index.php?dll=gallery&sub=upload","mywindow","menubar=1,resizable=1,width=660px,height=390px");
}
Is this achievable and if so, How, based on the code I've supplied.
Thanks
Share Improve this question asked Nov 1, 2011 at 14:27 StuBlackettStuBlackett 3,84915 gold badges71 silver badges116 bronze badges 2- Have a look at: developer.mozilla/en/DOM/… – Rob W Commented Nov 1, 2011 at 14:30
- 1 possible duplicate of Set position for new window – Quentin Commented Nov 1, 2011 at 14:31
4 Answers
Reset to default 2use the parameters top and left, e.g. window.open("index.php?dll=gallery&sub=upload","mywindow","menubar=1,resizable=1,width=660px,height=390px,top=0,left=0");
Having said that, managing popup windows can be troublesome. If it's not necessary for your application, I would simply create a DHTML dialog in your actual page, e.g. jQuery's dialog, jqueryui./demos/dialog .
In the 3rd parameter add a left
and a top
You can add top=?px,left=?px
to your propperties. For example
function openwindow()
{
window.open("index.php?dll=gallery&sub=upload","mywindow","menubar=1,resizable=1,width=660px,height=390px,top=100px,left=150px");
}
If you would like to position the popup on the screen, you can use the screenX and screenY properties when opening a window, like so:
window.open("index.php?dll=gallery&sub=upload", "mywindow", "menubar=1, resizable=1, width=660px, height=390px, screenX=80, screenY=300")
本文标签: JavaScript Window Open OptionsStack Overflow
版权声明:本文标题:JavaScript Window Open Options - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744627959a2616371.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论