Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-25-2011, 04:37 PM   PM User | #1
CodeSpaz
New to the CF scene

 
Join Date: Jul 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
CodeSpaz is an unknown quantity at this point
How can I add a Modal window pop up to a MapHilight hotspot?

Hello.

I am usually able to stitch together a website from various tutorials but this one has me stumped.
I want a hotspot l;ink to open a modal window on click. But I can't get the area tag 'href' to work. seems it needs to be an 'a href='.

The site can be found here:
http://www.kino.com/press/popup/

There are two hotspots. the one on the left is linked to the modal window (which doesn't work), the one on the right links to a website (as a test).
Beneath the image is a link with a functioning pop up modal window.

Can anyone tell me what I'm doing wrong?
CodeSpaz is offline   Reply With Quote
Old 07-25-2011, 09:35 PM   PM User | #2
harbingerOTV
Senior Coder

 
Join Date: Jan 2005
Location: Memphis, TN
Posts: 1,765
Thanks: 8
Thanked 123 Times in 121 Posts
harbingerOTV will become famous soon enough
change: $('a.poplight[href^=#]').click(function() {
to this: $('.poplight[href^=#]').click(function() {

your code is looking specifically for an 'a' that's why clicking and 'area' doesn't launch the pop up. By making the change above, the code will look for any element with the class of 'poplight' that has a '#' in the href.
__________________
Stop making things so hard on yourself.
i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis
harbingerOTV is offline   Reply With Quote
Users who have thanked harbingerOTV for this post:
CodeSpaz (07-25-2011)
Old 07-25-2011, 09:41 PM   PM User | #3
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
edit:
Nice. I've never used a selector in that fashion.

he's absolutely right, I just tried it out witht he firebug console and it works that way.

also fyi Your loading Jquery twice for some reason, you only need it once.
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users

Last edited by DanInMa; 07-25-2011 at 09:49 PM..
DanInMa is offline   Reply With Quote
Old 07-25-2011, 10:13 PM   PM User | #4
CodeSpaz
New to the CF scene

 
Join Date: Jul 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
CodeSpaz is an unknown quantity at this point
Fantastic! Works perfectly and the change was so small I would have missed it if oyu didn't explain it.
Thank you!
CodeSpaz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:07 AM.


Advertisement
Log in to turn off these ads.