SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Wellington, NZ
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with the zorn tooltip

    Hi,

    I'm using the javascript tooltip by watler zorn and i've come across a little problem.

    I've got an image that I've applied an image map to, and mousing over areas reveals the tootip. I've put some html in the tooltip, including a link. This is all fine, and the link works as expected.

    The problem is that if a user clicks on the area, they're taken to the page that the link points to, and what I want it to do is show the tooltip. But of course I can't put two events on one html tag, and I can't use a nested tag as suggested in the documentation as i'm using the area tag which is self closing.

    Does anyone know how to do this, without using a different tooltip script?

    here's the page with the problem - www.orpheecreation.com/artists.php

    Thanks
    Richard.

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can call multiple things from an inline event handler:
    HTML Code:
    <a href="page.html" onclick="function1(); function2(); function3(); return false;">Clicky</a>

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Wellington, NZ
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks, i didn't know that. But the problem is the tooltip only seems to work with an mouseover event handler, but for some reason you can also click IF there is a link in the tooltip, and you get taken to the url in the tooltip.

    How can I make clicking the link open the tooltip instead?

    Richard.

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That's what the return:false in the inline event handler does. It tells the element not to do what it normally would do if you click on it (go to the specified URL). Zorn might have included something else, and I don't want to look through his code.

    I don't understand what you are trying to do. This is what I think you want: you want someone to be able to show this tooltip if they mouse over parts of your image map. You also want this to happen if the user clicks on the image map, even if there is no link in the tooltip. Is this correct?

    From what I've seen, Zorn's scripts are rather bloated. Perhaps you could also check out these tooltip scripts. I don't know if they work with image maps though.

    http://www.robertnyman.com/glt/
    http://www.dustindiaz.com/sweet-titles/

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Wellington, NZ
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes that was exactly what I'm trying to do. I added onclick="return false;" and that has stopped the link being opened. So all's good.

    Thanks for you help

    Richard.


Bookmarks

Posting Permissions

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