Click to See Complete Forum and Search --> : Image map and openWindow


am89
07-11-2003, 01:41 PM
Hi:
I really need someone's help here.
I'm trying to add an openWindow to an image map I created in Imageready:
Here the code:

<img src="images/contact_nav.gif" width="290" height="116" border="0" usemap="#contact_nav_Map">
<map name="contact_nav_Map">
<area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html">
</map>

Now If I want a window to open on click on the area, but with a specific size, no toolbars and so on, where would I add the javascript? In the head, orin the tag itself? Both? AHHHHHH. Help,please.

Thanks
am

David Harrison
07-11-2003, 01:52 PM
If you create a function called openwindow() in the head section then you should just be able to put:

<area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html" onclick="openwindow();return false;">

Khalid Ali
07-11-2003, 01:52 PM
change this line to
<area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html">

<area shape="rect" alt="" coords="102,29,174,44" href="about_designer.html" onclick="return OpenWin(this)">

an in the head section of the page add the following code

<script type="text/javascript">
function OpenWin(obj){
var newWin = window.open(this.href,'newWin',"width:400,height=200,scrollbars=no,location=no");
return false;
}
</script>

Jona
07-11-2003, 01:54 PM
You could also try using target="_blank" to open it in a new window for those who have Javascript enabled; although, you would not be able to configurate the options.

[J]ona

am89
07-11-2003, 01:55 PM
Great!
I'll try it out.

Thank you very much.
am

Khalid Ali
07-11-2003, 01:57 PM
Originally posted by am89

but with a specific size, no toolbars and so on, where would I add the javascript? In the head, orin the tag itself? Both? AHHHHHH. Help,please.

Thanks
am

Hey Jona..I guess you missed that part..:D

Jona
07-11-2003, 02:01 PM
Oops!! :D

[J]ona