View Full Version : Image maps and pop-ups?
Neptune 03-08-2003, 09:25 PM I have a image that links to a pop-up, and i only want a certain part to be a link. I'm pretty sure I know how to do this, but it doesn't work. Is there an error or do they just not go together?
<html>
<head>
<title>Untitled/title>
<script language="javascript">
//<!--
function popup()
{ window.open ("inline.html","popup","width=900,height=600,location=0,menubar=0,resizabl e=0,scrollbars=0,status=0,titlebar=1,toolbar=0") }
-->
</script>
</head>
<body>
<MAP NAME="MyMap">
<AREA SHAPE="rect" COORDS="135,81,223,101" HREF="inline.html">
<area shape="default" nohref></map>
<a href="javascript:popup()"><img src="untitledfun.gif" border="0" USEMAP="#MyMap"></a>
</body>
</html>
MaGiCSuN 03-08-2003, 09:35 PM If you map your image you can make shapes on your image that have to be a link, that's the way to link a certain part of the image. I don't know any other ways with html.
You do have an image map, but you only got one link that is the whole graphic. When you made the image map you can select a shape and then make some 'shapes' on your image that become dotted and you can fill in url etc as you wish. Then not the <img> will become the link but the <area> parts will become links (the shapes are the 'areas')
then just fill in HREF="javascript:namepop()" that should work, i have it on my site too and it works perfect :)
love,
mirna
Neptune 03-10-2003, 09:55 PM I'm confused. I was trying to have an image map. But it wasn't working. My popup doesn't "pop up", it just remains in the same window. I understand some of what you're saying, I think. I still don't know what to change, though :(
Neptune 03-11-2003, 12:19 AM Okay, I got my pop up to work, and the button I want to be the link IS the link, but instead of the rest NOT being a link, it acts like a link, but isn't. What should I do?
<MAP NAME="MyMap">
<AREA SHAPE="rect" COORDS="135,81,223,101" href="javascript:untitled()"
<area shape="default" nohref></map>
<a href="javascript:untitled()"><img src="untitledfun.gif" border="0" width="360" height="116" USEMAP="#MyMap"></a>
Gannon7394 03-18-2003, 11:56 AM Hmm... would this work, perhaps?
<img src="untitledfun.gif" usemap="#MyMap" border="0" width="360" height="116"><map name="MyMap">
<area shape="rect" coords="135,81,223,101" href="javascript:untitled()">
</map>
Edited to add:
I think your problem is this -
<a href="javascript:untitled()"><img src="untitledfun.gif" border="0" width="360" height="116" USEMAP="#MyMap"></a>
In addition to making an image map, you've also made the entire image a link. Simply removing that link should solve the problem. I think. :)
MaGiCSuN 03-18-2003, 03:23 PM The code from neptune was good, the only that was missing was an area wich has to be linked.
an image map is an image with areas on it that are linked, not the whole image. What you did neptune is you linked the whole image, so basically the image maps are still missing. Add your image into your map program, then draw some shapes on it (the areas) and add that code to your html page.
If you want to link the whole image you don't need image maps, you can just link it.
Love,
Mirna
MaGiCSuN 03-18-2003, 03:37 PM Ok sorry for posting twice, but i was outside the 5 minutes of 'editing' :)
<!-- Created by CuteMAP -->
<!-- Visit us at http://www.globalscape.com -->
<!-- Beginning of CSIM -->
<IMG SRC="jlolayout.gif" USEMAP="#oldlayout.gif" WIDTH=780 HEIGHT=600 BORDER=0>
<MAP NAME="oldlayout.gif">
<AREA SHAPE=RECT COORDS="262,305,424,326" HREF="javascript:me()">
<AREA SHAPE=RECT COORDS="252,331,445,351" HREF="javascript:you()">
<AREA SHAPE=RECT COORDS="248,355,485,373" HREF="javascript:site()">
<AREA SHAPE=RECT COORDS="247,377,426,397" HREF="javascript:exit()">
<AREA SHAPE=RECT COORDS="258,399,423,417" HREF="javascript:gbook()">
</MAP>
<!-- End of CSIM -->
this is an image map code from me from an old layout. You see the image is as <img src> given. Then you have the area codes, wich are for the parts that have to be linked. this code above is for pop-ups. Do not copy this code, you have to go into your own program and make your own because the code above is build on another graphic so it won't fit.
so basically this must work for you:
<img src="untitledfun.gif" usemap="#MyMap" border="0" width="360" height="116"><map name="MyMap">
<area shape="rect" coords="135,81,223,101" href="java script:untitled()">
</map>
make sure you got the <script> code between your <head> and </head> for your pop-up to pop-up huh ? ;)
Love,
Mirna
|