views:

3973

answers:

1

i want hover over an image -> which is in an link

during i'm over the image should popup (like a tooltip) an div, which i can fill also with some stuff - any idea?!

$this is the link which includes an img: i found the image within and wanted to span a div above the image and make some jquery effects which lets the user get the info, that clicking the image wil enlarge it

     $(this).parent().append($("<div/>")
         .css({ "display" : "block", "left" : img.x, "top" : img.y,  
          "width" : img.width, "heigth" : img.heigth, "border" : "1px solid red"})
         .text("Click me!")

does not work :-/

+5  A: 

I believe you are looking for a tooltip function, there are quiet a few tooltip plugins already available, even with custom content, text, formatted text, custom layout, or even ajax content.

take a look at one of these plugins:

some have more options than the other, i used simpletip for some site and its great though its limited contentwise, what you want is probably more something like Qtip

Sander
i do not wanted any plugin only the core lib :-S
stephan
i'd go for the plugin if the plugin is well written (most of the time i'd find a way to do it myself but twice as long as the plugin did it)... but i can understand if you want to achieve this on your own.
Sander
yes you are right
stephan