# Help with Javascript Pop-ups

**URL:** <https://forum.kirupa.com/t/help-with-javascript-pop-ups/108204>\
**Category:** Uncategorized\
**Created:** [April 22, 2004, 4:08pm UTC](https://forum.kirupa.com/t/help-with-javascript-pop-ups/108204 "2004-04-22T16:08:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blatantdream](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@blatantdream](https://forum.kirupa.com/u/blatantdream)\
**Post date:** [April 22, 2004, 4:08pm UTC](https://forum.kirupa.com/t/help-with-javascript-pop-ups/108204/1 "2004-04-22T16:08:57Z")

</div>

[font=verdana, arial, helvetica][size=2]I am doing this website which has a pop-up page when you enter the page. Once you get into the main part, there are a couple of frames and a page that suppose to be a photo gallery. I have the photo gallery so that the when clicking on the thumbnails, the javascript will tell it to open another popup window constraining the size of the window to fit around the larger picture. The photo gallery as at  
[[color=#000020]http://www.blatantdream.com/aion/photo.htm[/color]](http://www.blatantdream.com/aion/photo.htm)

However, if you go through the regular way through the main page  
[[color=#000020]http://www.blatantdream.com/aion/[/color]](http://www.blatantdream.com/aion/) , when you click on the photo part and click on a picture, it opens up on top of the entire window. Is there a way to fix this?

This is the script I used:

\<script language=“javascript”\>  
function openWin(file)  
{  
var popUpWidth = 500;  
var popUpHeight = 375;  
var popUpTop = (screen.height - popUpHeight) / 2;  
var popUpLeft = (screen.width - popUpWidth) / 2;  
window.open(file, ‘live’, ‘top=’+popUpTop+’,left=’+popUpLeft+’,height=’+popU  
pHeight+’,width=’+popUpWidth);  
}  
\</script\>

and to open:

\<a href="#" onclick=“javascript:OpenWin(‘pics/live1.jpg’);”\>\<img src=“pics/live1\_th.gif” border=“0”\>\</a\>[/size][/font]
