# Javascript - pop-up box positioning

**URL:** <https://forum.kirupa.com/t/javascript-pop-up-box-positioning/178143>\
**Category:** Uncategorized\
**Created:** [February 8, 2006, 1:52am UTC](https://forum.kirupa.com/t/javascript-pop-up-box-positioning/178143 "2006-02-08T01:52:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirksmith](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@dirksmith](https://forum.kirupa.com/u/dirksmith)\
**Post date:** [February 8, 2006, 1:52am UTC](https://forum.kirupa.com/t/javascript-pop-up-box-positioning/178143/1 "2006-02-08T01:52:01Z")

</div>

hi

I’d like to adjust the js script below to position a pop-up box 100px from the top and 100px from the left - at the moment it’s scriped to position centrally.

Any ideas on what the script shld look like?

Thanx

Dirk

[INDENT] \_root.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) { getURL (“javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open(’” + url + “’,’” + winName + “’,’” + “width=” + w + “,height=” + h + “,toolbar=” + toolbar + “,location=” + location + “,directories=” + directories + “,status=” + status + “,menubar=” + menubar + “,scrollbars=” + scrollbars + “,resizable=” + resizable + “,top=’+((screen.height/2)-(” + h/2 + “))+’,left=’+((screen.width/2)-(” + w/2 + “))+’” + “’)}else{myWin.focus();};void(0);”);} [/INDENT]
