Giter Club home page Giter Club logo

jquery-cluetip's Introduction

jQuery clueTip Plugin

Important: This plugin is no longer being maintained.

I originally wrote clueTip back in 2006 as my first attempt at a jQuery plugin. If I were to write it now, I would do it completely differently. However, I don't have the time or energy to work on it. The good news is that you can use any one of a number of better tooltip plugins. Here are a few:

License

Dual licensed under the MIT license:

Copyright Karl Swedberg

Requirements

  • jQuery v1.3+

Description

Displays a highly customizable tooltip when the user interacts with the matched element. As of clueTip version 1.1, this plugin is ThemeRoller Ready.

Known Issues

  • When .cluetip() is invoked from an image map <area> element, the plugin ignores the postionBy option. Positioning the tooltip by the coords is beyond the scope of the plugin, so it instead falls back to positioning according to the mouse's position (event.pageX and event.pageY) when it enters the <area>.

Important clueTip 1.2 Change

Version 1.2 of the clueTip plugin changes the HTML structure of the tooltip. It uses classes instead of IDs for the elements within the clueTip. This allows multiple tooltips to be visible at the same time (one per call to the .cluetip() method) if the multiple option is set to true.

The plugin may not work as expected if you update jquery.cluetip.js to version 1.2+ and you don't also update the jquery.cluetip.css stylesheet.

If you have a lot invested in the old clueTip's structure with the IDs, you can get it back by:

  1. adding the lib/jquery.compat.cluetip.js file immediately after jquery.cluetip.js, AND
  2. replacing lib/jquery.cluetip.css with jquery.compat.cluetip.css.

Features

Options

The clueTip plugin allows for (too?) many options. For a complete list, check out the plugin's homepage

Content via ajax

By default, the clueTip plugin loads a page indicated by the "rel" attribute via ajax and displays its contents. However, the attribute to be used for both the body and the heading of the clueTip is user-configurable. If a "title" attribute is specified, its value is used as the clueTip's heading.

Content from HTML element

Optionally, the clueTip's body can display content from an element on the same page.

Just indicate the element's id (e.g. "#some-id") in the rel attribute.

Content from title attribute

Optionally, the clueTip's body can display content from the title attribute, when a delimiter is indicated.

  • The string before the first instance of the delimiter is set as the clueTip's heading.
  • All subsequent strings are wrapped in separate DIVs and placed in the clueTip's body.

Examples

Basic

This is the most basic clueTip. It displays a 275px-wide clueTip on mouseover of the element with an ID of "tip." On mouseout of the element, the clueTip is hidden.

$('#tip').cluetip();

Setting Multiple Options

The following displays a clueTip on mouseover of all <a> elements with class="clue". The hovered element gets a class of "highlight" added to it (so that it can be styled appropriately. This may be useful for non-anchor elements in older browsers such as IE6.). The clueTip is "sticky," which means that it will not be hidden until the user either clicks on its "close" text/graphic or displays another clueTip. The "close" text/graphic is set to display at the bottom of the clueTip (default is top) and display an image rather than the default "Close" text. Moreover, the body of the clueTip is truncated to the first 60 characters, which are followed by an ellipsis (...). Finally, the clueTip retrieves the content with a POST request rather than the default GET.

$('a.clue').cluetip({
  hoverClass: 'highlight',
  sticky: true,
  closePosition: 'bottom',
  closeText: '<img src="cross.png" alt="close" />',
  truncate: 60,
  ajaxSettings: {
    type: 'POST'
  }
});

Triggering the hideCluetip event (useful for touch devices)

You can programmatically hide (close) a clueTip by triggering the "hideCluetip" custom event. On a touch-enabled device, for example, you could hide any visible clueTips when the user touches anywhere in the body except on a link or on the clueTip itself:

$('body').bind('touchstart', function(event) {
 event = event.originalEvent;
 var tgt = event.touches[0] && event.touches[0].target,
     $tgt = $(tgt);

 if (tgt.nodeName !== 'A' && !$tgt.closest('div.cluetip').length ) {
   $(document).trigger('hideCluetip');
 }
});

More examples can be found at http://plugins.learningjquery.com/cluetip/demo/

Credits

  • Originally inspired by Cody Lindley's jTip (http://www.codylindley.com)
  • Huge thanks to Jonathan Chaffer, Glen Lipka, Shelane Enos, Hector Santos, Torben Schreiter, Dan G. Switzer, Jörn Zaefferer, and the many others who helped report and fix bugs and suggest features.

jquery-cluetip's People

Contributors

jasonedanrice avatar jeffgoo avatar kswedberg avatar phayes avatar usmonster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-cluetip's Issues

Arrow is displayed "out" of the window when the link triggering the tooltip appears at the bottom of the viewable page

Hi,

I think this is more a design thing but I was wondering if you have a suggestion for this.

I really like this plug-in so I was doing several tests and this happened to me when I had a long list with one of the columns containing a hyperlink to open the tooltip. ClueTip was customized to show arrows. When I clicked on the last hyperlink, the tooltip appeared and the arrow was shown half "on the air".

It also happens if you go to the demo site and position the "jTip Style clueTip" link so it appears "glued" to the bottom of the page (last link in the page), then try to see the tooltip. Not a big problem for me but maybe for the design team.

Thanks a lot!

Positioning off when triggered programmatically

I have an element with a sticky cluetip with activation='click'. If I programmatically trigger the cluetip with $(cluetipped).click(), the event has no pageX/pageY values, so the waitImage is never visible and the final positioning is off.

It'd also be handy to have a manual "show" method, since the programmatic .click() is kind of hacky.

When adding a clueTip to an <a href='page.html' title='title|body here' class="clueTip">Click here to open page.html</a> does not navigate to page.html

when using tool tip in a Click here to open page.html
after clicking on the anochor tag, it no longer navigates to the appropriate link.

I want to get the ClueTip title and content from the @title attribute of the anchor tag, so on hover to the anochor tag i can see the cluetip and on click i can open the page.

I am initiating the cluetip as below: on the $(document).ready()

$("a.clueTip").cluetip({ splitTitle: '|', tracking: true, positionBy: 'mouse'});

even on the documentation page mentioned on http://plugins.learningjquery.com/cluetip/demo/
under the 7th point of Default styles, it still doesn;t navigate the user to the appropriate href page.

I would like to have a clueTip on hover and still want to navigate to the page on click of the link

Please help me, and let me know whats wrong.

I know the workaround is to add an onclick event and navigate to the appropriate resource that i want. but i dont want it to be like that way.

suggestion: set maximum width as negative integer

Hi,

with enabled auto-width support, it would be practical to limit maximum width like this:

e.g.
width: -300,

(negative 300)
would mean that maximum allowed outer/inner layer width is 300px.
Idea taken from walter zorn's js tooltip.

regards
lubosdz

Question about cluetip and iframe

Hi!

Thanks for the improvements done to the Cluetip plug-in!

I've put it into an application. The problem that I have is that the structure for this application (which I cannot change) works with an iframe with the scrolling disabled (scrolling="no").

And the css it uses has the "html" and "body" with "overflow: hidden" so scrollbars don´t appear for the page.
Within the iframe, pages loaded have a div wrapping the content and this div has "overflow:auto" so scrollbars can be displayed this way.

When this happens, the cluetip window does not move along with the scrolling. I could reproduce this in a small test project.
But the cluetip window does move with "normal" scrolling (I mean, if the whole page has scrolling enabled or if the iframe has scrolling enabled instead of using the overflow in css to handle it).
I don´t know why this happens.

My question is, could there be any way to "workaround" it?

Thanks!

How To Write Ajax Request In JavaScript

$.ajax(
url: '/Package/ViewPost',
type:'POST',
data: 'Test,
success: function(data) {
//Process data
},
error: function(error) { }
);

But it is not working .help me out form this.Give me a good example for this and also its code with Demo

Thanks a lot in advance

Hovering twice in IE to show cluetip

I'm using Cluetip and loading content via ajax, in IE I have to hover twice to get it to show and this only works with cache on.

The reason is around line 250-ish in the cluetip.js file, there is a line that says imgs[i].complete, this always returns false for me when testing in IE 8, in FF it works perfectly.

Also inside the bind 'load error' the imgCounter never decreses, so everything just stops there.

I had to comment out this, and just always show the cluetip.

Here's the hacked code:

                           for (var i = 0, l = imgs.length; i < l; i++) {
                                if (imgs[i].complete) {
                                    imgCount--;
                                }
                            }
                            if (1 = 0) {
                                if (imgCount && !$.browser.opera) {
                                    $(imgs).bind('load error', function () {
                                        imgCount--;
                                        if (imgCount < 1) {
                                            $cluetipWait.hide();
                                            if (isActive) { cluetipShow(pY); }
                                        }
                                    });
                                } else {
                                    $cluetipWait.hide();
                                    if (isActive) { cluetipShow(pY); }
                                }
                            }
                            // HACK
                            $cluetipWait.hide();
                            if (isActive) { cluetipShow(pY); }

Is this a bug or am I the only one experiencing this problem?

href not working (demo item 7)

As I understand the functionality of item 7 from the demo (http://plugins.learningjquery.com/cluetip/demo/), hovering should invoke the tooltip and clicking the link should take me to the href url (http://www.learningjquery.com/). However, when I click on the link, nothing happens. I can right-click to go to the href link, but I can't get it to load directly. This appears to be true on FF 3.5 and IE8 on Windows 7. Can you confirm that my understanding of this functionality is correct, and the current behavior is a bug?

EDIT--Sorry, I just read the open issues and saw the clickThrough: true solution. I will implement that now. I would encourage you to make this the default behavior. Thanks for a great tool!

rounded and arrows does not work

I am using the following code:

$('a.jt').cluetip({cluetipClass: 'rounded', arrows: true, dropShadow: false});

I do not get it to work the two properties together, can you help me?

activation: 'focus' - mouse over shows title (FIX)

adding:

$this.bind('mouseover.cluetip', function(event) {
$this.attr('title','');
}).bind('mouseleave.cluetip', function(event) {
$this.attr('title', $this.data('thisInfo').title);
});

to the "// activate by focus; inactivate by blur " section fixes the issue.

ajaxCache issue

Line 200 currently reads:
cache: false, // force requested page not to be cached by browser

It probably should be:
cache: opts.ajaxCache, // force requested page not to be cached by browse

We changed this code for our Oracle Application Express to disable the &= feature when opts.ajaxCache = true otherwise it always has the &= option (&_= breaks Oracle Application Express's procedures).

Cursor issue

When a css "cursor" value is set on an element, after the first cluetip activation, the "cursor" value is lost.

I traced the removal of CSS cursor value to:

// close cluetip and reset some things
var cluetipClose = function() {
$cluetipOuter
.parent().hide().removeClass();
opts.onHide.call(link, $cluetip, $cluetipInner);
$this.removeClass('cluetip-clicked');
if (tipTitle) {
$this.attr(opts.titleAttribute, tipTitle);
}
$this.css('cursor','');
if (opts.arrows) {
$cluetipArrows.css({top: ''});
}
};

I think it should be:

if (tipAttribute == $this.attr('href')) {
$this.css('cursor','');
}

This is because we only set the cursor in activate function when tipAttribute == $this.attr('href').

Positioning sticky cluetip not correct while tabbing in IE

It seems that positioning the cluetip using the TAB and ENTER keys (on hyperlinks), still depends on current mouse position in both IE7 and IE8. So if I put the mouse somewhere else on the page and open a cluetip using the keybord only, the cluetip appears on the position where the mouse cursor resides.

cluetip 1.1 - Test configuration used:
$('#clickme').cluetip({activation: 'click', positionBy: 'auto', splitTitle: '|', sticky: true});

Regards

Need to avoid scroll to top on opening cluetip

Hi,
I'm using the Cluetip in a page inside the container which is having 50% width & has scroll with some height set. The problem is when you scroll down & activates the tooltip control, it scrolls to top of the container and the tooltip appears in between.

cluetip doesn't track elements appended by ajax

$.get('HotelPlans.html', function(html) {
var newHtml = $(html);
newHtml.appendTo('#ratebreakup');
newHtml.find('a.ratetooltip').cluetip({ attribute: href });
where HotelPlans.html is my html page

ratebreakup is my id

ratetooltip is my class name
This three thing is on other page...
Sending Request…
$.get('HotelPlans.html', function(html) { var newHtml = $(html); newHtml.appendTo('#ratebreakup'); newHtml.find('a.ratetooltip').cluetip({ attribute: href }); where HotelPlans.html is my html page #ratebreakup is my id ratetooltip is my class name This three thing is on other page...

Thanks in advance

Cluetip's local content pull fails on 2nd and following tips when using jQuery Filtering selector

I just figured out the hard way that when rel attributes with certain jQuery selectors are used to load local content from a page, cluetip fails to load the content on all but the first tip.

In my case, I am trying to create multiple tips on one page, each pointing to an

  • in a list of references. The first tip works great, but the second and all subsequent tips fail to retrieve their local content, showing only empty white boxes despite using the same selector style:
    <sup><a href="ol:last li:eq(0)" class="cluetip-reference" rel="ol:last li:eq(0)">1</a></sup <sup><a href="ol:last li:eq(1)" class="cluetip-reference" rel="ol:last li:eq(1)">2</a></sup>
    where:

    <li >Reference item one</li>
    <li>Reference item two</li>
    </ol>```
    
    Here's my doc-ready code:
    ```$(document).ready(function() {
        $('.cluetip-reference').cluetip({arrows: true,dropShadow:true,cluetipClass:'jtip',local:true,hideLocal:false,multiple:true,showTitle:false});
    });```
    
    My workaround for now unfortunately has required me to add IDs to my ```<li>```'s, as simple css selectors in the del attribute don't seem to fail.
    
  • splitTitle - why supports only link title attribute?

    Hi,

    many times, tooltip content has to be loaded from another element than <a href="" ... > link element (local: true). Unfortunatelly, it looks like in this case, loading the title from the element's title attribute is not supported.

    Example:

    I need to load title from the
    <div id="tooltip-content" title="tooltip some title"> tooltip content</div>
    Unfortunatelly, this does not work:

    settings = {local:true,splitTitle:'|',};
    $('#show-tooltip').cluetip($("#source-element").html(),settings);

    Thank you.
    Cheers
    lubosdz

    activation: 'focus' does not work right

    5 input fields on form, tabbing, setting focus sets the cluetip, but as u tab down, the cluetip remain next to first input field that had focus. Blur seems funcky

    Issue with CSS not displaying correctly in custom tips

    Hi -

    Within my code, I have the default clueTip definition, and a custom tip.

    I modified the default tooltip to display a drop shadow in FireFox - and the code below works fine.

    When I made the same changes to the custom tip the drop shadow doesn't work at all in the new tip.

    Here are the pieces of code:
    Found in the
    $('.dspDetails').cluetip({
    splitTitle: '|',
    dropShadow: false,
    showTitle: false,
    positionBy: 'bottomTop',
    topOffset: 15,
    cursor: 'pointer',
    width:300,
    cluetipClass: 'details',
    clickThrough: true
    });

    $('.infoTip').cluetip({
        splitTitle: '|', 
        dropShadow: false, 
        showTitle: false,
        positionBy: 'bottomTop', 
        topOffset: 15,
        cursor: 'pointer', 
        width:300,
        clickThrough: true
    }); 
    

    Found in the CSS:

    .cluetip-default #cluetip-outer {
    position: relative;
    margin: 0;
    background-color: #FF9;
    border:1px solid #000;
    font-family:Arial, sans-serif;
    font-size:12px;
    color:#000;
    /* outline radius for mozilla/firefox only */

    -moz-box-shadow:0 0 10px #000;
    -webkit-box-shadow:0 0 10px #000;
    }

    .cluetip-details {
    position: relative;
    margin: 0;
    background-color: #FF9;
    border:1px solid #000;
    font-family:Arial, sans-serif;
    font-size:12px;
    color:#000;
    text-align:left;
    padding: 5px 5px 5px 15px;
    /* outline radius for mozilla/firefox only */

    -moz-box-shadow:0 0 10px #000;
    -webkit-box-shadow:0 0 10px #000;
    }

    Any and all response is appreciated.

    Thanks.

    Title - is never hidden

    Hi,

    it looks like the title is never hidden...?
    I tried to turn it off via showTitle:false, since it cannot load title from another attribute than link's title, but it never disappears...

    perhaps
    $cluetipTitle.hide()
    does not work well..?

    regards
    lubosdz

    Use of delayedClose together with sticky / mouseOutClose

    I tried to use options delayedClose together with sticky, as in: close the tooltip after 500ms when not in the tooltip. I don't want to have a close button. My version now looks like this:

    
    if (opts.delayedClose > 0) {
              if (opts.sticky) {
                  $this.bind('mouseenter', function() {
                      clearTimeout(closeOnDelay);
                  }).bind('mouseleave', function() {
                      clearTimeout(closeOnDelay);
                      closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
                  });
                  $cluetip.bind('mouseenter', function() {
                    clearTimeout(closeOnDelay);
                  });
              } else {
                  closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
              }
          }
    

    There may have to be a check if the option mouseOutClose is set, too.

    Dropshadow in IE

    I can't get the dropshadow to work properly in IE8 and haven't seen a fix posted for this issue. When you initialize the dropShadow flag IE displays the shadow above the inner content div.

    I've tried to tweak the z-index of the various divs, change background colors all to no avail. Any help would be appreciated.

    Cheers!

    cluetip doesn't track elements appended by ajax

       $.get('/path/to/file', function(html) {
      var newHtml = $(html);
      newHtml.appendTo('#some-elememnt');
      newHtml.find('a').cluetip();
    });
    

    I want an example for this.

    Its very urgent

    Thanks a lot.......

    jquery 1.6.x issue: arrows do not display, due to: .attr() vs .prop()

    jQurey 1.6.0 introduced a backwards incompatibility in the use of .attr() and introducing .prop().

    The patch below fixes all setings of properties through .prop( name, value) instead of through .attr().

    Index: components/com_comprofiler/js/jquery-1.5.0/jquery.cluetip.js
    ===================================================================
    --- jquery.cluetip.js   (revision 1509)
    +++ jquery.cluetip.js   (working copy)
    @@ -381,7 +381,7 @@
             var $localContent = $(tipAttribute + (/#\S+$/.test(tipAttribute) ? '' : ':eq(' + index + ')')).clone(true).show();
             if (opts.localIdSuffix) {
    -          $localContent.attr('id', $localContent[0].id + opts.localIdSuffix);
    +          $localContent.prop('id', $localContent[0].id + opts.localIdSuffix);
             }
             $cluetipInner.html($localContent);
             cluetipShow(pY);
    @@ -445,7 +445,7 @@
           if (ctClass == 'rounded') {
             dynamicClasses += ' ui-corner-all';
           }
    -      $cluetip.css({top: tipY + 'px'}).attr({'className': standardClasses + dynamicClasses});
    +      $cluetip.css({top: tipY + 'px'}).prop({'className': standardClasses + dynamicClasses});
           // set up arrow positioning to align with element
           if (opts.arrows) {
             var bgY = (posY - tipY - opts.dropShadowSteps);
    @@ -492,7 +492,7 @@
           opts.onHide.call(link, $cluetip, $cluetipInner);
           $link.removeClass('cluetip-clicked');
           if (tipTitle) {
    -        $link.attr(opts.titleAttribute, tipTitle);
    +        $link.prop(opts.titleAttribute, tipTitle);
           }
           $link.css('cursor','');
           if (opts.arrows) {
    @@ -521,11 +521,11 @@
       // activate by focus; inactivate by blur
           } else if (opts.activation == 'focus') {
             $link.bind('focus.cluetip', function(event) {
    -          $link.attr('title','');
    +          $link.prop('title','');
               activate(event);
             });
             $link.bind('blur.cluetip', function(event) {
    -          $link.attr('title', $link.data('cluetip').title);
    +          $link.prop('title', $link.data('cluetip').title);
               inactivate(event);
             });
       // activate by hover
    @@ -565,9 +565,9 @@
             }
    
             $link.bind('mouseover.cluetip', function(event) {
    -          $link.attr('title','');
    +          $link.prop('title','');
             }).bind('mouseleave.cluetip', function(event) {
    -          $link.attr('title', $link.data('cluetip').title);
    +          $link.prop('title', $link.data('cluetip').title);
             });
           }
         });

    cluetip not loading external html on multiple links

    My html code is as follows:

    Click Me!!!!!!!!

    Also Click Me!!!!!!!! <script src ="jquery/themeswitchertool.js" type="text/javascript"></script> <script src="jquery/jquery.hoverIntent.js" type="text/javascript"></script> <script src="jquery/jquery.bgiframe.min.js" type="text/javascript"></script> <script src="jquery/jquery.cluetip.js" type="text/javascript"></script> <script src="jquery/demo.js" type="text/javascript"></script>

    I am loading external html "ajax6.htm" in cluetip. This is working fine for very first link, but not work for 2nd anchor tag.

    Please provide solution asap

    Problems with Cluetip website

    Problem One

    1. Go here... http://plugins.learningjquery.com/cluetip/
    2. Click on menu tab 2 called "Demo"...
    3. Result: You get an Alert box saying, "There is no such container."
    4. Click "OK" button and proceed to demo page.

    ...continue for Problem Two...

    1. Scroll down to bottom of Demo page.
    2. Go to "Rounded Corners Theme" section.
    3. Go to Item 4 called "non-caching ajax clueTip with arrows enabled"... enable what arrows?
    4. Hover over item as mentioned and I do not see any arrows in Safari or Firefox... don't know about IE.

    ...continue for Problem Three...

    1. On Demo page, instead of hover, simply click on any link and you're taken to a new page in the same window containing the text of the tip. These links are for hovering, shouldn't the click be disabled?

    hides entire document when splitTitle and not explicit hideLocal (Chrome and IE)

    I am using 1.0.7, line 79 looks like this:
    if (opts.local && opts.hideLocal) { $(tipAttribute + ':first').hide(); }
    The tipAttribute is blank and thus hides entire document when rel attribute is not set. I fixed it like this:
    if (opts.local && opts.hideLocal && tipAttribute != '') { $(tipAttribute + ':first').hide(); }
    Firefox works fine, and I saw the error in IE and Chrome.

    insertionType & insertionElement setup values are ignored

    The setup object is never used when inserting/creating the cluetip div:

        /* clueTip setup
         *  the setup options are applied each time .cluetip() is called,
         *  BUT only if <div id="cluetip"> is not already in the document
        */
        setup: {
          // method to be used for inserting the clueTip into the DOM.
          // Permitted values are 'appendTo', 'prependTo', 'insertBefore', and 'insertAfter'
          insertionType: 'appendTo',
          // element in the DOM the plugin will reference when inserting the clueTip.
          insertionElement: 'body'
        },
    

    The following lines use the options object rather than the setup object...

        /** =create cluetip divs **/
        var insertionType = (/appendTo|prependTo|insertBefore|insertAfter/).test(options.insertionType) ? options.insertionType : 'appendTo',
            insertionElement = options.insertionElement || 'body';
    

    Ajax loads repetitivly in IE

    Strange issue here.
    Everything goes right with Firefox.
    But in IE, when I invoke an ajax php file with ClueTip, the file is loaded again and again twice per second.
    You can't notice it unless you have animated gif in the file, or unless you stick the clueTip, so that you see the "Close" text appending again and again, which makes it appear many times.

    Issue with duplicated content

    Hi,

    I'm using cluetip with these settings:

    $(document).ready(function () {
    $('a.header').cluetip({
    showTitle : false,
    cluetipClass: 'jtip',
    arrows: false,
    dropShadow: true,
    hoverIntent: false,
    sticky: true,
    mouseOutClose: true,
    closePosition: 'title',
    closeText: 'x',
    local: true,
    hideLocal: true,
    topOffset: 8,
    leftOffset: 5,
    width: 100
    });
    });

    The problem is that the tooltip sticks, and as soon as hover off the link, and hover on the same link again, the content in the cluetip is duplicated. I worked around the issue with this option now:

    onActivate: function (e) { $("#cluetip-inner").html(''); return true; }

    Thanks for an otherwise excellent control :)

    suggested change: position by fixed

    Hi all,

    I would like suggest to remove the linkWidth in the calculation of posX as follows:

    // position clueTip horizontally
    if (opts.positionBy == 'fixed') {
    posX = linkLeft + lOffset;
    $cluetip.css({ left: posX });
    }

    or make it more flexible.

    Brgrds,

    ajax problem after updating cluetip to 1.2

    I have just updated cluetip from 1.1pre (2010-10-20) to version 1.2
    and this piece of code stop working:

          $(".title").each( function () {
    
            var val1 = $(this).attr("name").toString().split("-")[0];
            var val2 = $(this).attr("name").toString().split("-")[1];
    
            $(this).attr("rel",   host + "cluetip.php").cluetip({
    
                arrows: true,
                cluetipClass: 'jtip',
                width: '250px',
                dropShadowSteps:  4,
                ajaxSettings : {
                     type : "GET",
                     data : "val1=" + val1 + "&val2=" + val2
                },
                ajaxProcess : function (data) {
                     return data;
                }
    
            });
    
          });
    

    The cluetip not showing up, other tips are working ok, only that above not (I have jquery 1.6.2 btw)
    Can anyone know why this happened?

    Ajax request don't display in ie6

    When I load content via ajax . Content don't display in tip area in ie6 browse. Other browse work well.
    $('#change_smile').cluetip({
    local:false,
    positionBy:'bottomTop',
    arrows: true,
    cursor: 'pointer',
    sticky: true,
    closePosition: 'title', // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
    closeText: '',
    dropShadow: true,
    hoverIntent: false,
    activation: 'click',
    width:'236px'
    });

    Dynamically resizing a cluetip in IE

    In my cluetip I have a bit of hidden text that can be shown (JQuery's slideToggle) with a mouse click. In Chrome and Firefox, the box resizes nicely when the hidden text is revealed. In IE 8, however, the cluetip sticks to its original size.

    CSS fix - #cluetip-outer

    Hi,

    to auto-expand outer layer (#cluetip-outer) according to the content loaded inside (#cluetip-inner),
    add following CSS into #cluetip-outer class:

    display: inline-block;

    This will make outer layer auto-adjust according to the width of the loaded inner layer.
    Tested on FF3.5, O10, IE8.

    In this case, however, shadow should expand to the width of the #cluetip-outer, not #cluetip-inner.

    Cheers
    lubosdz

    Issue with Tooltip disappearing after AJAX call.

    Hello -

    I am using Ingrid (jQuery plugin) and clueTip on my pages.

    On initial page load, Ingrid loads as part of the page, creates a table with a thead and a tbody.

    The thead has tool tips coded into each column header title.

    When a column is resorted, Ingrid's design only pulls back and updates the tBody section, so that it doesn't worry about updating the thead section.

    The column that was resorted, loses the TITLE tooltip information. The other tooltips remain, but the one selected disappears.
    When examined through Firebug, only the content of the grid is being passed.

    What is happening with the tool tip?

    Thanks.

    no tooltip body when local, div with a title and no split

    The following code:

    <div title="This is simply a test">mouse over me for tip</div>
    

    and then in jquery

    $('div[title]').cluetip({ showTitle: false, attribute: 'title', local:true });
    

    The title is not displayed as the tooltip.

    Around line 260 add a check for this scenario
    /***************************************
    * load an element from the same page
    **************************************/
    } else if (opts.local) {
    /
    not showing title, no split title, attribute set and not a id: show attribute text as body
    * example of this would be

    something

    * and use $('div[title]').cluetip({ showTitle: false, attribute: 'title', local:true });
    */
    if (!opts.showTitle && !opts.splitTitle && tipAttribute.indexOf('#') !== 0) {
    $cluetipInner.html(tipAttribute);
    } else {
    var $localContent = $(tipAttribute + (/#\S+$/.test(tipAttribute) ? '' : ':eq(' + index + ')')).clone(true).show();
    if (opts.localIdSuffix) {
    $localContent.attr('id', $localContent[0].id + opts.localIdSuffix);
    }
    $cluetipInner.html($localContent);
    }
    cluetipShow(pY);
    }
    };

    patch for CSS classes not being properly applied to element

    I believe this line:
    $cluetip.css({top: tipY + 'px'}).attr({'className': standardClasses + dynamicClasses});

    should be:
    $cluetip.css({top: tipY + 'px'}).attr({'class': standardClasses + dynamicClasses});

    Line 438 in current revision:
    https://github.com/kswedberg/jquery-cluetip/blob/master/jquery.cluetip.js#L438

    Currently it results in adding a classname attribute to the DOM element rather than class. I was having issues with the arrows not appearing and this turned out to be the cause.

    Removing the hideCluetip event binded on the document when destroying a cluetip

    Hi,

    Thanks for jquery-cluetip !

    I am using it in an ajax application, so adding and removing cluetips many times. The problem is that ClueTip is not removing its hideCluetip event on the document when a cluetip is destroyed.
    It ends having many useless hideCluetip events who will never be unbinded, unless reloading the full page...

    Here is the guilty line :
    $(document).bind('hideCluetip', function(e) {
    cluetipClose();
    });

    I propose this instead (untested) :
    var __doc_handler = function(e) {
    cluetipClose();
    }
    $(document).bind('hideCluetip', __doc_handler);
    $this.bind('remove', function () {
    $(document).unbind('hideCluetip', __doc_handler);
    })

    Then we just have to do the following the remove the event (it is done automatically by jQuery UI) :
    $('#my_tip').triggerHandler('remove')

    in focus event, no mouse position is available thus bottomTop must be used

    //activate clueTip
    ....
    linkTop = posY = $link.offset().top;
    linkLeft = $link.offset().left;
    mouseX = event.pageX; // BUG: undefined/unrelated with a tabbing between fields without mouse click......
    mouseY = event.pageY;

    should be:

      linkTop = posY = $link.offset().top;
      linkLeft = $link.offset().left;
    

    //FIX:
    linkWidth = $link.innerWidth(); //Fix of old bug 4412
    if ( (event.type) == focus ) {
    // in focus event, no mouse position is available this is needed with bottomTop:
    mouseX = linkLeft + ( linkWidth / 2 ) + lOffset;
    $cluetip.css({left: posX});
    mouseY = posY + tOffset;
    } else {
    mouseX = event.pageX;
    mouseY = event.pageY;
    }
    //END OF FIX

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.