Position javascript window.open centered on secondary screen?
I have this code from an example:
<script type="text/javascript">
function open_and_move2(){
win3=window.open("page.htm","","width=开发者_运维知识库600,height=500")
win3.moveTo(screen.width/2-300,screen.height/2-250)
}
</script>
It works just fine with the exception that, if the browser window is located at a secondary screen, the javscript window pops up on the main screen.
Seems like the calculated offsets would be correct for the secondary screen, but the offsets are executed on an absolute scope.
I would like to have a window open on click positioned in the middle of the current screen or current window.
How can I do that?
The reason is that I am implementing single sign on for a website and this should be used for a comments plugin.
精彩评论