Click to See Complete Forum and Search --> : Hotspot new window size


Lisae
01-08-2003, 12:46 PM
I have an image map and want to control the size of the windows that are opened when the hotspot is clicked on. I tried putting width and height in the area tag, but that didn't work. Does anyone know if there is a way to do this with Javascript?

pyro
01-08-2003, 01:05 PM
I don't totally understand what it is that you are trying to do. Are you trying to open a new window when you click the hotspot? Maybe you could post some code or a link...

gil davis
01-08-2003, 01:06 PM
Warning! Cross-posted on the HTML forum.

Lisae
01-08-2003, 01:38 PM
Below is the code. The documents that the hotspots link to would look much better in a smaller window, so I want to be able to specify the height and width, but I tried putting them in the area tag, as in the second area tag, but it had no affect.

<img src="Hardware_Screenshot.jpg" width="788" height="576" usemap="#Hardware" border="0">

<map name="Hardware">

<area shape="rect" coords="1,163,772,179" href="../Other_Issues.htm" alt="Click for more information..." title="Click for more information..." target="_blank">

<area shape="rect" coords="395,133,525,149" href="../Tivoli.htm" alt="Click for more information..." title="Click for more information..." target="_blank" height="300" width="300">

</map>

Zach Elfers
01-08-2003, 01:48 PM
I think I know what you mean... don't use _blank as the target. This will just open a new window which you can't control. If you want to control a windows size, you should do it like this:

<head>
<script language="JavaScript" type="text/JavaScript">
<!--

function newWin(page, w, h) {
newWindow = window.open(page,"","menubar=yes,width=" + w + ",height=" + h + ",toolbar=yes,status=yes,resizable=yes,location=yes);
newWindow.focus();
}

// -->
</script>
...
<body>
<area shape="rect" coords="1,163,772,179" href="javascript:newWin('Other_Issues.htm', 50, 50);" alt="Click for more information..." title="Click for more information..." target="_blank">

See where it says "50, 50". That is the height and width of the new window in pixels. Change that to whatever you want.

NOTE: The order of "50,50" is width and then height, not h then w.

pyro
01-08-2003, 01:51 PM
First of all, don't cross post threads. It is a waste of all of out time to be answering your questions more than once.

Next, I wrote up some code for you. If you can't figure out what's going on, let me know...It's pretty easy, though.

pyro
01-08-2003, 01:53 PM
...Oops. Looks like Zach beat me to it. Well, you can use which ever one you want to, then...

Lisae
01-10-2003, 12:03 PM
got it...thanks guys