Content of element as "content"

Joshua Works's Avatar

Joshua Works

03 May, 2010 10:49 PM

Is it possible to use the content of the hovered element (like $(this).html()) instead of an attribute of the element for the tooltip? How?

  1. 1 Posted by DHarnan on 17 Dec, 2010 03:42 AM

    DHarnan's Avatar

    Here is a solution for a hover event with custom content.

    $(".someClass").hover(

    function() {
        $(this).tipTip({
            activation: "focus",
            defaultPosition: "right",
            delay: 0,
            content: $(this).children("div").html()
        });
        $(this).focus();
    },
    function() {
        $(this).blur();
    }
    

    );

  2. 2 Posted by Jorge Sandoval on 31 Jan, 2012 10:35 PM

    Jorge Sandoval's Avatar

    Great! thank you DHarnan!

  3. 3 Posted by Niacris on 20 May, 2013 01:26 PM

    Niacris's Avatar

    It would be better this way:

    $(".someClass").each(function() {
        $(this).tipTip({
            delay: 0,
            content: $(this).children("div").html()
        });
    });

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

08 Feb, 2017 08:05 AM
08 Feb, 2017 08:02 AM
08 Feb, 2017 07:56 AM
08 Feb, 2017 07:53 AM
08 Feb, 2017 07:45 AM