ok, first off i’m a bit of a javascript noob so please excuse my semi-pseudo code. i’m working on an cropping tool so i have a small (500×250) popup that initially loads, when i click a button I’m response.redirecting back to the same window (long story but it has to work like this) and the window needs to now change to 800×700 but ideally i’d like it centered on the screen. the code below is an excerpt from my popup that is fired when i reload my page (based on a certain condition). The parent.resizeTo works ok but the parent.left, parent.top bit isn’t. Anyone got any ideas as i’m sorta making this up as i go along. The ltClose bit is an asp.net control i’m writing to to trigger this.
ltClose.Text += “<script type=””text/javascript””>” & vbCrLf
ltClose.Text += “parent.resizeTo(800,700);” & vbCrLf
ltClose.Text += “var width = 800;” & vbCrLf
ltClose.Text += “var height = 700;” & vbCrLf
ltClose.Text += “var left = parseInt((screen.availWidth / 2) – (width / 2));” & vbCrLf
ltClose.Text += “var top = parseInt((screen.availHeight / 2) – (height / 2));” & vbCrLf
ltClose.Text += “parent.left=left ;” & vbCrLf
ltClose.Text += “parent.top= top ;” & vbCrLf
ltClose.Text += “parent.screenX= left ;” & vbCrLf
ltClose.Text += “parent.screenY= top;” & vbCrLf
ltClose.Text += “</script>”