PDA

View Full Version : A newbie question



black_substanze
03-16-2006, 01:49 AM
Hi guys/gals

I have a quick question pertaining to web design, however using a particular java script to generate pop ups. Now my issue is as follows: I have created a website that resides in a big pop up but I need to open additional pop ups while in the "main popup".

The problem is that when I try to do so it overrides the "main popup" when I want it to open in a seperate popup untop of that pop up. Any help would be appreciated.

Javascript that goes in the head of the page:

<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
</script>

Body of page:

<a href="images/forsale/foxrun/bigpictures/picture2.html" onClick="NewWindow(this.href,'name','720','530','n');return false">
<img border="0" src="images/forsale/foxrun/pic2.gif" width="120" height="120">

jscheuer1
03-16-2006, 01:56 AM
By naming a window, in this case you've given it the name of 'name', and then later opening into the same named window, you will overwrite the existing window of the same name:


<a href="images/forsale/foxrun/bigpictures/picture2.html" onClick="NewWindow(this.href,'name','720','530','n');return false">

If however, you use a unique name for each additional window, it will create its own distinct window:


<a href="images/forsale/foxrun/bigpictures/picture2.html" onClick="NewWindow(this.href,'fred','720','530','n');return false">