• This repository has been archived on 06/Oct/2021
  • Stars
    star
    219
  • Rank 181,133 (Top 4 %)
  • Language
    JavaScript
  • Created almost 16 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

No longer maintained/supported. โ€” Displays a highly customizable tooltip when the user hovers (default) or clicks (optional) the matched elements.

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.

More Repositories

1

jquery-smooth-scroll

Automatically make same-page links scroll smoothly
JavaScript
1,970
star
2

jquery-tmbundle

TextMate bundle for jQuery
XML
562
star
3

jquery-expander

Expand and Collapse HTML content
JavaScript
460
star
4

jquery-carousel-lite

A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha
JavaScript
179
star
5

grunt-version

Handle versioning of a project using grunt
JavaScript
51
star
6

jquery-tinyvalidate

A (relatively) tiny form validation plugin
JavaScript
16
star
7

jquery-fancyletter

A jQuery plugin that lets you prettify your web page by styling the first letter of any element
JavaScript
12
star
8

jQuery-API-Search

JSONP API for searching the jQuery API at http://api.jquery.com/
JavaScript
10
star
9

jquery-defaulttext

sets default text overlay on top of a text input
JavaScript
8
star
10

ks.markitup.fieldtype.ee_addon

A markItUp field type for the Field Frame ExpressionEngine extension
JavaScript
8
star
11

jQuery-sameHeight

makes collection of elements all the same height
JavaScript
7
star
12

ks.clearcache.ee_addon

ExpressionEngine module to clear cache from front-end using ajax
6
star
13

jquery-summarize

A simple plugin to initially display only a certain number of children, with a "read more" link
JavaScript
6
star
14

jquery-biglinks

jQuery plugin to increase the target area of links to a containing element
JavaScript
6
star
15

jquery-socialize

jQuery Plugin for adding a group of social bookmarks to a blog post
5
star
16

hotspotter.ee_fieldtype

Image "Hotspot" fieldtype for Expression Engine's Field Frame extension
JavaScript
5
star
17

dotfiles

dot files for my MBP
Shell
5
star
18

new-tab-bookmarks

Chrome extension to show bookmarks (from folder of your choice) in new tab
Vue
5
star
19

atom-jquery

A collection of jQuery snippets derived from my TextMate bundle
CSS
4
star
20

ks.facelift.ee_addon

Uses Facelift Image Replacement script (w/o JavaScript) to convert text to images
PHP
4
star
21

ump

Version bumping without the b
JavaScript
4
star
22

jquery-columns

puts children of a containing element into the number of columns that you specify (and deals with <ol> numbering)
JavaScript
4
star
23

fusionary-tmbundle

TextMate bundle for HTML, CSS, and JavaScript to make work at Fusionary more streamlined.
4
star
24

ks.slashee.ee_addon

ExpressionEngine plugin to add or remove starting and/or ending slashes for a string
3
star
25

ks.karls-extra-head.ee_addon

ExpressionEngine extension allowing user to add any html to the end of the document head for control panel pages
2
star
26

blog.karlswedberg.com

A blog about some techie things
JavaScript
2
star
27

triib-scrape

CLI tool to extract all Triib members' workout history
JavaScript
2
star
28

ksjs

Random js functions
JavaScript
1
star
29

c2md

Output HTML clipboard contents to markdown in the terminal (MacOs only)
JavaScript
1
star
30

dotatom

My .atom files, sourced.
JavaScript
1
star
31

grwebdev-201707

Presentation for GRWebDev Meetup, 25 July 2017
JavaScript
1
star
32

tagify.ee_addon

ExpressionEngine (EE) plugin to convert [tagname param="foo"] to {tagname param="foo"} in entry field so it can be parsed by EE
PHP
1
star