hey peeps n freeks...
my dilemma...
i have a script that opens a pic in a new window when a link is clicked. you can close the window by clicking on the window itself. now... that's all fine and dandy, but what if the user doesn't close the window and wants to see another picture...
when another link is clicked, the picture window is now beneath the site window.
how can i make it so when the link is clicked, it either closes the previous window then opens another one, or it brings the window back to the front.
do you get it?
thanks for your time and help!
peace.
..::: code :::..
<!--open pic in new window BEGIN-->
<script language="JavaScript">
function openImage(images, w, h)
{
var windowprops = "location=no,scrollbars=no,menubar=no,toolbar=no" + ",left=300,top=100" + ",width=" + w + ",height=" + h + ";"
a = window.open("","popupimage",windowprops);
a.document.open();
a.document.write('<html><body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">');
a.document.write("<a href='javascript:window.close()'><image src='" + images + "' width=" + w + " height=" + h + " border='0' alt=''></a>"
;
a.document.write('</body></html>');
a.document.close();
}
</script>
<!--open pic in new window END-->
<!-- link for picture -->
<a href="javascript
penImage('pic.jpg',400,250)">Picture</a>
<!-- link for picture -->
my dilemma...
i have a script that opens a pic in a new window when a link is clicked. you can close the window by clicking on the window itself. now... that's all fine and dandy, but what if the user doesn't close the window and wants to see another picture...
when another link is clicked, the picture window is now beneath the site window.
how can i make it so when the link is clicked, it either closes the previous window then opens another one, or it brings the window back to the front.
do you get it?
thanks for your time and help!
peace.
..::: code :::..
<!--open pic in new window BEGIN-->
<script language="JavaScript">
function openImage(images, w, h)
{
var windowprops = "location=no,scrollbars=no,menubar=no,toolbar=no" + ",left=300,top=100" + ",width=" + w + ",height=" + h + ";"
a = window.open("","popupimage",windowprops);
a.document.open();
a.document.write('<html><body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">');
a.document.write("<a href='javascript:window.close()'><image src='" + images + "' width=" + w + " height=" + h + " border='0' alt=''></a>"
a.document.write('</body></html>');
a.document.close();
}
</script>
<!--open pic in new window END-->
<!-- link for picture -->
<a href="javascript
<!-- link for picture -->