Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

img maps & pop up 1

Status
Not open for further replies.

Berns

IS-IT--Management
Apr 25, 2002
41
US
I have to develop code for an image map and pop-up. I have a large image, I want to develop and image map - which I can do with out a problem. The problem that I am having is intergrating the pop up piece. When a user clicks on an area on the image map I need a pop up to appear. Can anyone please get me started with some code.
 
Berns...

Here is a sample where I put the code to popup the window inline:

Code:
<map name=&quot;myimap&quot;> 
<area shape=&quot;circle&quot; coords=&quot;70,84,51&quot; href=&quot;javascript:var myWin=window.open('[URL unfurl="true"]http://www.someplace.org','myPop1','')&quot;>[/URL] 
</map>

Another example that builds on the previous one where you use a function (probably more useful if you have many regions in your imagemap):

Code:
<script type=&quot;text/javascript&quot;>
function popwindow(_myNumber)
{
  var _myURL = &quot;&quot;;
  if (_myNumber == 'abc')
    _myURL = &quot;[URL unfurl="true"]http://www.soterm.com&quot;;[/URL]
  if (_myNumber == 'jsh')
    _myURL = &quot;[URL unfurl="true"]http://www.coedit.com&quot;;[/URL]
  if (_myNumber == 'xyz')
    _myURL = &quot;[URL unfurl="true"]http://www.erealisation.co.nz&quot;;[/URL]
	
  if (_myURL != &quot;&quot;)
    var myWin=window.open(_myURL,'myPop1','')
}
</script>

<map name=&quot;myimap&quot;> 
<area shape=&quot;circle&quot; coords=&quot;70,84,51&quot; href=&quot;javascript:popwindow('jsh')&quot;> 
</map>

Hopefully this gives you enough of an insight to continue!

Jeff
 
Hi berns

This will work, if you insert this hyperlink (a href...) into your <map> code:

<a href=&quot;#&quot; target=&quot;_self&quot; onClick=&quot;MM_openBrWindow('nameof_popup_page.html','Type_anything_here_followed_by_PopUp','scrollbars=yes,width=550,height=350')&quot;>

example:

<a href=&quot;#&quot; target=&quot;_self&quot; onClick=&quot;MM_openBrWindow('texas_region_pop.html','Texas_Product_PopUp','scrollbars=yes,width=550,height=350')&quot;>



Hope that helps.

Cheers

MHUK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top