最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jquery tooltip shows a div's content - Stack Overflow

programmeradmin2浏览0评论

I want to use either / or / and I 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.

I want to use either http://onehackoranother./projects/jquery/tipsy/ or http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ and I 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.

Share Improve this question asked Apr 14, 2010 at 19:46 jimjim 1,1372 gold badges12 silver badges23 bronze badges 1
  • 2 What you are looking for is a tooltip that can include html contnet. flowplayer/tools/demos/tooltip/any-html.html – Enrique Commented Apr 14, 2010 at 20:08
Add a ment  | 

2 Answers 2

Reset to default 4

You could look into qTip

http://craigsworks./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)

  1. 暂无评论