/    Sign up×
Community /Pin to ProfileBookmark

Pop-up Window!!!

I would like to have the function ability of having the pop-up window stay on top of the main window when I click on another thumbnail for detail. What’s happening now is the old pop-ups are collecting behind the main window. I want the detail pop-up to close each time a new detail pop-up is clicked.
JavaScript code

[code=html]
Header:
<script type=”text/javascript” src=”http://127.0.0.1:37935/xpopup.js”></script><script language=”JavaScript” type=”text/JavaScript”>
<!–
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf(“#”)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf(“?”))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//–>
</script>
[/code]

[code=html]
Body:
<table border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center”>
<!– Main –>
<tr><td width=”510″ align=”center” valign=”top”><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><img src=”images/mirocha.jpg” name=”mat_lg” id=”mat_lg”></td>
<!– Thumbs –>
<td width=”300″ align=”absmiddle” valign=”top”>
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p> &nbsp; <a href=”javascript:history.go(-1)” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘arrow2′,”,’images/arrow-l1.jpg’,1)”><img src=”images/arrow-l2.jpg” alt=”back” name=”arrow2″ border=”0″ align=”absmiddle”></a> &nbsp; &nbsp; <a href=”../park/park.htm” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘arrow’,”,’images/arrow-r1.jpg’,1)”><img src=”images/arrow-r2.jpg” alt=”next illustrator” name=”arrow” border=”0″ align=”absmiddle”></a> &nbsp; &nbsp; <strong><font color=”#ffffff” size=”2″ face=”Verdana, Arial, Helvetica, sans-serif”>paul mirocha </font><font color=”#ffffff” size=”3″ face=”Verdana, Arial, Helvetica, sans-serif”>- <font size=”2″>illustrator</font></font></strong></p>
<table width=”300″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr><td align=”center” valign=”middle”><a href=”#” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘jungle’,”,’images/jungle-vegetation_sd.jpg’,1)”><img src=”images/jungle-vegetation_s.jpg” name=”jungle” width=”60″ height=”60″ border=”0″ onClick=”MM_openBrWindow(‘images/jungle-vegetation_detail..jpg’,”,’width=600,height=450′)” onMouseOver=”MM_swapImage(‘mat_lg’,”,’images/jungle-vegetation_b.jpg’,1)”></a></td>
<td align=”center” valign=”middle”>
<a href=”#” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘birds’,”,’images/birds_sd.jpg’,1)”><img src=”images/birds_s.jpg” name=”birds” width=”60″ height=”60″ border=”0″ onClick=”MM_openBrWindow(‘images/birds_detail.jpg’,”,’width=600,height=450′)” onMouseOver=”MM_swapImage(‘mat_lg’,”,’images/birds_b.jpg’,1)”></a></td>
<td align=”center” valign=”middle”><a href=”#” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘berries’,”,’images/berries_sd.jpg’,1)”><img src=”images/berries_s.jpg” name=”berries” width=”60″ height=”60″ border=”0″ onClick=”MM_openBrWindow(‘images/berries_detail.jpg’,”,’width=600,height=450′)” onMouseOver=”MM_swapImage(‘mat_lg’,”,’images/berries_b.jpg’,1)”></a></td>
<td align=”center” valign=”middle”><a href=”#” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘milk-splash’,”,’images/milk-splash-fruit_sd.jpg’,1)”><img src=”images/milk-splash-fruit_s.jpg” name=”milk-splash” width=”60″ height=”60″ border=”0″ onClick=”MM_openBrWindow(‘images/milk-splash-fruit_detail..jpg’,”,’width=600,height=450′)” onMouseOver=”MM_swapImage(‘mat_lg’,”,’images/milk-splash-fruit_b.jpg’,1)”></a></td>
<td align=”center” valign=”middle”><a href=”#” onMouseOut=”MM_swapImgRestore()” onMouseOver=”MM_swapImage(‘green-beetle’,”,’images/green-beetle_sd.jpg’,1)”><img src=”images/green-beetle_s.jpg” name=”green-beetle” width=”60″ height=”60″ border=”0″ onClick=”MM_openBrWindow(‘images/green-beetle_detail.jpg’,”,’width=600,height=450′)” onMouseOver=”MM_swapImage(‘mat_lg’,”,’images/green-beetle_b.jpg’,1)”></a></td></tr></table>
[/code]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@felgallMar 17.2008 — Why not just change the value of the second parameter of the window.open() command to something other than '_blank' so that they all just reuse the same window instead of having each open a new one.
×

Success!

Help @david4123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...