开发者

jquery tooltip shows a div's content

I want to use either http://onehackoranother.com/projects/jquery/tipsy/ or http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ and I开发者_Python百科 was wondering if lets say I have a div on my page that has a class 'item_info'.

Can I have my tooltip that is created output the div inside the tooltip and formatted properly according to my css?

Is there another plugin I should be looking into?

Thanks. I hope this is clear enough.


You could look into qTip

http://craigsworks.com/projects/qtip/demos/


http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ allows you to specify additional css class for your tooltip styling as well as display "dynamic" data for the text. Take a look at the example below.

Notable areas: bodyHandler specifies which text to show in your tooltip (this will return your html from div), extraClass specifies css style to apply. Hope that helps.

$("#your_tooltip_element").tooltip(
    {
        bodyHandler: function() {
            return $("#your_div").html();
        },
        showURL: false,
        track: true,
        delay: 0,
        showURL: false,
        opacity: 1,
        fixPNG: true,
        extraClass: "item_info",
        top: -15,
        left: 5,
        cursor: "hand"
        }
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜