Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    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

  • Users who have thanked harbingerOTV for this post:

    CodeSpaz (07-25-2011)

  • #3
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    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.
    Last edited by DanInMa; 07-25-2011 at 09:49 PM.

  • #4
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Fantastic! Works perfectly and the change was so small I would have missed it if oyu didn't explain it.
    Thank you!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •