Solved

Call Shadowbox or Javascript function from imagemap link

Posted on 2009-03-31
5
1,187 Views
Last Modified: 2013-11-11
Hello experts,

I've been trying to show a modal window (shadowbox), using an imagemap instead of the <a> tag. Does anyone know how can I get it to work?

Or at least call a javascript function when clicking on an image map area?

Thank you very much,
Mircea
0
Comment
Question by:mircea_a
  • 2
  • 2
5 Comments
 

Author Comment

by:mircea_a
ID: 24031160
By the way by shadowbox I mean shadowbox.js

Thanks again,
Mircea
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24036641
<area onClick="someJSFunction(); return false" ...

or for old browsers

<area href="void(someJSFunction())" ...
 
0
 

Expert Comment

by:jeff9661
ID: 24695956
I have the same issue. I had someone write the attached Javascript which works great by assigning the class to the <a> tag. However I don't know how to tie this script / class  into your example above. I don't have to have both class options. I'm currently using the bottom one '560x470'

This is how I use it with a standard HREF:
<a href="popUpStyles/harmonyElite.html" class="560x470">Harmony Elite</a>

This is my image map code:
 <area  shape="poly" coords="65,160,110,135,111,33,155,15,150,6,67,37" href="popUpStyles/harmonyElite.html" alt="Harmony Elite" />




<script type="text/javascript">

	$(document).ready(function(){

		$('a.500x415').openDOMWindow({ 

			width:508,

			height:423,

			positionType:'centered', 

			eventType:'click', 

			windowSource:'iframe',

			windowPadding:0

		});

		

		$('a.560x470').openDOMWindow({ 

			width:568,

			height:478,

			positionType:'centered', 

			eventType:'click', 

			windowSource:'iframe',

			windowPadding:0

		});

	});

</script>

Open in new window

0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 24698885
Did you try
$('area.500x415')

and

 <area  class="500x415" shape="poly" coords="65,160,110,135,111,33,155,15,150,6,67,37" href="popUpStyles/harmonyElite.html" alt="Harmony Elite" />

0
 

Expert Comment

by:jeff9661
ID: 24700599
Yes, that did the trick. Thought it was something like that. Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now