Flayckz
Flayckz

Reputation: 77

JqueryUI tooltip positioning

I am using JqueryUI.tooltip to make a picture visible when hovering over a text. http://jsfiddle.net/gwj230rn/

    <script language="javascript">
    $(document).ready(function() 
    {
        $(".imagehover").tooltip
        ({    
            items: "[data-src]",
            content: function () 
            {
                return '<img src="' + $(this).data("src") + '" />';
            },
            tooltipClass:"tooltipImg",
            position:
            { 
                within: ".usertable"

            },
            track:true  
        });
    });
</script>

the .usertable is a table which is always larger than the browsers visible area. Is there another parameter like "visiblearea" or something like that for within positioning?

Upvotes: 1

Views: 61

Answers (1)

Jeff Zheng
Jeff Zheng

Reputation: 26

div.ui-tooltip {
    max-width: 100%;
}

This solution readjusts the tooltip div to wrap around the contents of its children.

Upvotes: 1

Related Questions