Click to See Complete Forum and Search --> : Popups from an image map


Lenab
09-01-2004, 10:11 AM
I'm a newcomer to Javascript so I hope that some clever person out there can help me.

I have created a page with a six section image map, each section opening a small popup window. Each popup has a hyperlink which I want to open in a new window in full screen. Problem is that window opens in the same size as the popup. Will be very grateful for any help.

My script is as follows:

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Test</title>
<script LANGUAGE="JavaScript">
<!-- Begin
function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=200,height=275");
}

function popUp(URL,w,h,t){
if(!w) w = 175;
if(!h) h = 300;
_ id =(new Date()).getTime();
window["page" + id] = window.open(URL, id, "width="+w+",height="+h);
if(t){
_ window.setTimeout("page"+id+".close()", t);
}
}
function popFull(URL,t){
w = screen.width;
h = screen.height;
id =(new Date()).getTime();
window["page" + id] = window.open(URL, id, "top=0,left=0,width="+w+",height="+h);
if(t){
_ window.setTimeout("page"+id+".close()", t);
}
}
// End -->
</script>

</head>

<body>

<p align="center">

<map name="FPMap0">
<area href="javascript:popUp('http://www............/ConPop.htm',200,200,5000)" shape="rect" coords="13, 14, 56, 50">
<area href="javascript:popUp('http://www............/AssPop.htm',200,275,5000)" shape="rect" coords="86, 13, 135, 43">
<area href="javascript:popUp('http://www............/DemPop.htm',200,275,5000)" shape="rect" coords="161, 14, 214, 44">
<area href="javascript:popUp('http://www............/MigPop.htm',200,275,5000)" shape="rect" coords="239, 18, 283, 46">
<area href="javascript:popUp('http://www............/InServPop.htm',200,275,5000)" shape="rect" coords="304, 18, 354, 37">
<area href="javascript:popUp('http://www............/TermPop.htm',200,275,5000)" shape="rect" coords="393, 21, 431, 42">
</map>
<img border="0" src="cadmit.gif" usemap="#FPMap0" width="454" height="57"></p></map>

</body>

</html>

b_simpson1999
09-02-2004, 05:45 AM
try this <html><head><title>Test</title></head>

<script language="JavaScript">


<!--

/* $Id: openwin.js,v 1.4 1998/05/06 14:55:42 busser Exp $ */

function makewin (targurl, width, height, winopts) {

/* IE 3 browsers and version 2 browsers will fail this test */

if (navigator.userAgent.indexOf("MSIE 3.0") == -1 && navigator.appVersion.indexOf("2.0") == -1)
{

/* Check for existence of sidebars object. If non-existent, then create it */

if (window.sidebars == null)
{
sidebars = new Object;
sidebars.length = 1;
}

allopts = "width=" + width + ",height=" + height + "," + winopts;

/* Create the new window and update the sidebars array object */
var tempref = window.open(targurl, "sidebar" + sidebars.length, allopts);

sidebars[sidebars.length] = tempref;
sidebars.length++;
}
else
{
self.location.href = targurl;
}
}



// -->


</script>

<body>

<p align="center">

<map name="FPMap0">
<img border="0" src="cadmit.gif" usemap="#FPMap0" width="?" height="?">
<area href="javascript:makewin('file.html', w, h, 'scrollbars,resizable')" shape="?" coords="?, ?, ?, ?">
<area href="javascript:makewin('file.html', w, h, 'scrollbars,resizable')" shape="?" coords="?, ?, ?, ?">
<area href="javascript:makewin('file.html', w, h, 'scrollbars,resizable')" shape="?" coords="?, ?, ?, ?">
<area href="javascript:makewin('file.html', w, h, 'scrollbars,resizable')" shape="?" coords="?, ?, ?, ?">
<area href="javascript:makewin('file.html', w, h, 'scrollbars,resizable')" shape="?" coords="?, ?, ?, ?">
<area href="javascript:makewin('file.html', w, h, 'scrollbars,resizable')" shape="?" coords="?, ?, ?, ?"></map></p></body></html> just fill in the ? and the file.html oh yeah if the popup window you trying to open is in the same dir you only have to put the file name, hope you understand

Lenab
09-02-2004, 06:38 AM
Great, works fine. Many thanks