Opentip is an open source javascript tooltip based on the protoype framework.

Related tags

Tips opentip
Overview

Opentip

Opentip is a free opensource Java-Script tooltip class.

Features

It supports:

  • Stems (little pointers)
  • Automatic content download with AJAX
  • Different styles
  • Automatic repositioning of the tooltip if it's not in the viewport of the browser anymore
  • All kind of triggers (The tooltip can be triggered by mouse over, click, form submit,... everything you can think of really)
  • CSS3 Animations
  • Well tested, with over 200 unit tests

As of Version 2.0 Opentip does no longer depend on Prototype. You can choose any adapter you want so you can work with the framework of your choice.

Supported frameworks are:

If you want to contribute, please read on in the contribute file. If you are migrating from version 1.x please refer to the migration section

Build status

Master Build Status

Develop Build Status

Installation

jQuery, Prototype, Native

Just download lib/opentip.js and lib/adapter.FRAMEWORK.js and include them in this order. You can also take the already minified and combined files in the downloads/ folder.

Component

The easiest and recommended way to install opentip is with component. Just add enyo/opentip as dependency in your component.json and rebuild it.

Simply requiring opentip then activates the tooltips: require "opentip";

Ender

If you prefer ender as package manager just install it like this:

$ ender build opentip

Bower

Another package manager supported is bower:

$ bower install opentip

You should include opentip's CSS as well. It's in css/opentip.css. (Except for component of course which automatically bundles the css.)


If you want to work it with <=IE8, you have to include excanvas as well. Please refer to the installation guide.

Usage

Version 2.4.6

With HTML data attributes:

<div data-ot="Tooltip content" data-ot-show-on="click">Click me</div>

or with the Javascript API:

$('elementId').opentip('Content', { showOn: "click", ...options... });

For the complete documentation please visit www.opentip.org.

Future plans

  • Become library independant. I'm currently working on extracting all prototype functionality, so I can switch library easily. The next library I'll support will be jquery, and then mootools.

  • Add more skins.

  • Add cooler loading animation.

  • Implement unit tests.

If you have ideas, please contact me!

Contribute

Please refer to the CONTRIBUTING readme.

Migrating from Opentip 1.x to 2.x

Those are the major changes you should look out for when migrating from 1.x to 2.x:

  • There's no Tip or Tips object anymore. Everything is done through Opentip

  • The recommend way to create opentips now is to call new Opentip(element, content, title, options), or with the framework of your choice (eg, ender: $("#my-div").opentip(content, title options))

  • The instantiation of new tips inside an event (eg: onclick, onmouseover) is no longer supported! This would create new opentips everytime the event is fired.

  • Opentip.debugging = true; does no longer exist. Use Opentip.debug = true;

  • Positions are no longer of the weird form [ "left", "top" ] but simply strings like "top left" or "right"

  • stem.size has been dropped in favor of stem.length and stem.base

  • Most of the design is now done in JS since the whole thing is a canvas now.

  • The way close buttons are defined has completely changed. Please refer to the docs for more information.

Tagging

Tagging in this project is done with my tag script.

Authors

Opentip is written by Matias Meno.
Original graphics by Tjandra Mayerhold.

Contributors

Thanks to the following people for providing bug reports, feature requests and fixes:

  • Torsten Saam
  • Aaron Peckham
  • Oguri
  • MaxKirillov
  • Nick Daugherty

If I forgot somebody, please just tell me.

Related projects

You might also be interested in my formwatcher or dropzone.

License

(The MIT License)

Copyright (c) 2012 Matias Meno <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • does hide() also destroy?

    does hide() also destroy?

    If the tool tip is created programmatically, and shown on create and then hidden on keydown, will the tool tip also be destroyed automatically when hidden?

    I am using Opentip for form validation so when an error is detected, new Opentip() is called and then when the user starts to type, the tool tip hides.

    This one page has many form fields in many tab groups. The browser stays at one url for hours. Tabs and html windows ajax dynamic content as needed.

    Guess the point is "new Opentip()" might be called hundreds of times so unless these are getting destroyed or there is a better way to show the tool tip, this might present a memory leak.

    Do i need to worry about this or does Opentip handle it?

    opened by bmcgin 15
  • Opentip on disabled form element

    Opentip on disabled form element

    Hi Matias!

    I noticed that if you attach an opentip to a form element (in my case a radio button), the tip stops showing if you disable that element. In my case I would like to pop up an explanation to the user for why the radio button is disabled. Is this a possible change?

    Cheers and thanks for a very useful library -- christer

    opened by chrilleferna 12
  • Viewport containment doesn't work for fixed tooltips

    Viewport containment doesn't work for fixed tooltips

    It seems like when fixed: true is being passed to the tooltip, the code that makes sure the tooltip is displayed within the viewport isn't run? I'd love to get a quick workaround for that (I need fixed: true to allow the user to select text from the tooltip itself, which isn't possible when the tooltip keeps running away)

    opened by abyx 12
  • AjaxCache property

    AjaxCache property

    Hi,

    I'm trying to use the attribute ajaxCahce but it seems to doesn't work fine. I've tried this

    data-ot-ajaxCache="false"

    but the conent of the tool tip is downloaded just once.

    Such suggestion ?

    thanks

    Marco

    bug unverified 
    opened by marcogrosseto 12
  • Use of classList and

    Use of classList and

    I've noticed that the opentip-native-excanvas.js used classList. This causes huge IE issues 7/8/9. It also uses addEventListener.

    Why do you say the plugin works for all browsers from IE7+ if this is the case?

    Workaround for classList...

    https://github.com/eligrey/classList.js

    Workaround for addEventListener...

    if (!this.unwrap(t).addEventListener) return this.unwrap(t).attachEvent(e,i); else return this.unwrap(t).addEventListener(e,i,!1);

    opened by spindi 8
  • tooltip jolt issue in MacOS Safari browser

    tooltip jolt issue in MacOS Safari browser

    When the form first loads, and for a period afterwards, there are screen jolts each time a help icon is moused over. This issue is occurred only on MacOs Safari browser.

    Below is the code i have used to open tool tip

    $(img).opentip(title, { showEffect: 'blindDown', tipJoint: "top left", removeElementsOnHide: true, stem: true, target: true, tipjoint: ['center', 'top'], hideTrigger: "tip", hideTriggers: ["trigger", "tip"], showOn: "creation", hideOn: "mouseout", fixed: true, background: "rgb(234, 236, 240)", borderColor: "rgb(187, 187, 187)" });

    please help me on this.

    Regards, Raj.

    opened by raj2907 7
  • Ability to keep tooltip open if cursor is on tooltip itself

    Ability to keep tooltip open if cursor is on tooltip itself

    I'm not a developer so please excuse my ignorance.

    I'd like to know if a problem can be overcome please.

    At the moment, I have an icon, which if I mouse over, the tooltip shows. If I move the cursor away from the icon, the tooltip fades away.

    If I move the cursor on to the tooltip itself, so away from the icon and on to the tooltip, the tooltip disappears.

    The reason I want the tooltip to stay if my cursor remains on the tooltip is so that I can click on a hyperlink within the tooltip, or perhaps even copy the tooltip text. But I do want the tooltip to auto disappear after my is moved away from the icon or the tooltip on display, rather than having to manually click to close.

    Can you please tell me if what I am trying to achieve is possible, and if so what needs to be changed ?

    Many thanks.

    opened by youglobal 7
  • Opentip does not save DOM modification between openings

    Opentip does not save DOM modification between openings

    When DOM inside a tooltip is modified the change is not saved and disappears when the tooltip is opened again. This is a big drawback when creating an interactive tooltip. Is there any way to work around?

    Anyway, thanks for creating and sharing this really nice library!

    todo feature 
    opened by pioterj 7
  • CSS conflict with HTML5 Boilerplate front-end template

    CSS conflict with HTML5 Boilerplate front-end template

    I am developing a webpage that uses HTML5 Boilerplate as a front-end template. Recently I received a request from the client to include some fancy tooltips on my web page, so I googled a bit and chose Opentip as a fitting js tooltip framework.

    The problem is that !important switch from HTML5BP .hidden class:

    /*
     * Hide from both screenreaders and browsers: h5bp.com/u
     */
    
    .hidden {
        display: none !important;
        visibility: hidden;
    }
    

    messes up Opentip tooltips (tested on Ubuntu 12.04.1 with Chromium 24.0.1312.56 and Firefox 19.0):

    tooltips displaying properly

    tooltips displaying incorrectly (HTML5BP .hidden class added to CSS)

    Can you/will you fix it somehow?

    opened by czers 7
  • hideOn not working

    hideOn not working

    I am trying to show the tooltip on mouseover, and hide it on mouseout.

    The tooltip shows fine, but never hides.

    I am using coffeescript, and have tried this on latest Firefox, Safari and Chrome versions.

    myInput = $(".alert")
    inputOpentip = new Opentip(myInput,
        title: "Title!!!",
        showOn: "mouseover",
        target: true,
        hideTriggers: ["tip", "trigger", "target"],
        hideOn: "mouseout"
    )
    

    Am I missing something here ?

    opened by shahzebkhan 6
  • Tooltips sometimes being placed at 0, 0 instead of actual element

    Tooltips sometimes being placed at 0, 0 instead of actual element

    Me again :) So my code just loops over the rows in my view and create tooltips for each. With each refresh I get a different few rows whose tooltips get displayed at [0, 0] (actually [12, 12], but might have something to do with the fact I have offset = [5, 5]).

    It's a different row each time, making it seem random. I'm printing to the console whenever I create the tooltip, to make sure that the element is indeed already in the DOM before creating the tooltip, and they all are. What am I doing wrong?

    opened by abyx 6
  • Switch styles on the fly?

    Switch styles on the fly?

    I've tried a few options, but without reloading the page, is there a simple way to switch opentip styles 'on the fly' for use in dark/light mode situations?

    I know I can set Opentip.defaultStyle = "dark", but then changing that again to another style has no effect. Is there a way to reinitialize opentip or change styles immediately?

    Thanks in advance

    opened by coryf-ctl 0
  • Tooptip positioning

    Tooptip positioning

    Hi. I tried to email someone about this, but apparently the email doesn't work, so I thought I'd try here. I'm making a line chart, and I'd like to make it so the tooltip bubble stays with the line from data point to data point rather than following the mouse (See link since there doesn't seem to be a way to post pictures).

    The docs reference a way to manually position where the tool tip is, but I didn't see any information on how to actually do that.

    Something along the lines of what happens in the chart at this link is what I need: https://bl.ocks.org/Qizly/5a78caaf03ed96757e72

    I'd post the images, but it seems like there's no way to do that here.

    Thanks for any help.

    opened by ckrobinson83 0
  • docs: Fix simple typo, funtion -> function

    docs: Fix simple typo, funtion -> function

    There is a small typo in downloads/opentip-jquery-excanvas.js, downloads/opentip-native-excanvas.js, downloads/opentip-prototype-excanvas.js.

    Should read function rather than funtion.

    opened by timgates42 0
  • Show effect only executed the first time the tooltip is displayed

    Show effect only executed the first time the tooltip is displayed

    In my application, the show effect is only executed the very first time my tooltip is displayed! When I mouseover again on the trigger element, the tooltip is displayed immediately, without any fade in effect...

    (but the hide effect is always executed!)

    Am I missing an obvious configuration?

    opened by electrotype 0
  • Add sticky option

    Add sticky option

    If you're opening a tooltip on a scrollable page, such as a map, the icon will scroll with the page. It'd be great if there was a sticky option, as has been done with Leaflet.js's popup and Tippy.js's tooltip

    opened by wazcov 0
A simple CSS tooltip made with Sass

Simptip [v1.0.4] A simple CSS tooltip made with Sass Visit Site, Documentation and some examples Installation Install with npm, Yarn or Bower: npm: np

Arash Manteghi 650 Dec 14, 2022
A tooltip style toolbar jQuery plugin

Toolbar.js A jQuery plugin that creates tooltip style toolbars. Update Toolbar.js has been overhauled with new functionality, a completely new design

Paul Kinzett 2.3k Dec 18, 2022
A CSS only tooltip library for your lovely websites.

Hint.css A tooltip library in CSS for your lovely websites Demo • Get started • Who's using this? • Browser support • FAQs • Contributing • License hi

Kushagra Gour 8.3k Jan 2, 2023
⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

⚡️Blitz 12.5k Jan 4, 2023
Reference for How to Write an Open Source JavaScript Library - https://egghead.io/series/how-to-write-an-open-source-javascript-library

Reference for How to Write an Open Source JavaScript Library The purpose of this document is to serve as a reference for: How to Write an Open Source

Sarbbottam Bandyopadhyay 175 Dec 24, 2022
The JavaScript library let’s you transform native tooltip’s into customizable overlays.

iTooltip The JavaScript library let’s you transform native tooltip’s into customizable overlays. Use: <script src="/path/to/iTooltip.js"></script> <sc

null 2 Dec 17, 2021
wolkenkit is an open-source CQRS and event-sourcing framework based on Node.js, and it supports JavaScript and TypeScript.

wolkenkit wolkenkit is a CQRS and event-sourcing framework based on Node.js. It empowers you to build and run scalable distributed web and cloud servi

the native web 1.1k Dec 26, 2022
A damn-sexy, open source real-time dashboard builder for IOT and other web mashups. A free open-source alternative to Geckoboard.

freeboard free·board (noun) *\ˈfrē-ˌbȯrd* the distance between the waterline and the main deck or weather deck of a ship or between the level of the w

freeboard 6.3k Dec 28, 2022
An Open-Source Platform to certify open-source projects.

OC-Frontend This includes the frontend for Open-Certs. ?? After seeing so many open-source projects being monetized ?? without giving any recognition

Open Certs 15 Oct 23, 2022
Shikhar 4 Oct 9, 2022
This is a project for open source enthusiast who want to contribute to open source in this hacktoberfest 2022. 💻 🎯🚀

HACKTOBERFEST-2022-GDSC-IET-LUCKNOW Beginner-Hacktoberfest Need Your first pr for hacktoberfest 2k22 ? come on in About Participate in Hacktoberfest b

null 8 Oct 29, 2022
A jQuery tooltip plugin

Tooltipster A flexible and extensible jQuery plugin for modern tooltips by Caleb Jacob and Louis Ameline under MIT license. Compatible with Mozilla Fi

Caleb Jacob 2.8k Dec 29, 2022
A simple CSS tooltip made with Sass

Simptip [v1.0.4] A simple CSS tooltip made with Sass Visit Site, Documentation and some examples Installation Install with npm, Yarn or Bower: npm: np

Arash Manteghi 650 Dec 14, 2022
A tooltip style toolbar jQuery plugin

Toolbar.js A jQuery plugin that creates tooltip style toolbars. Update Toolbar.js has been overhauled with new functionality, a completely new design

Paul Kinzett 2.3k Dec 18, 2022
A CSS only tooltip library for your lovely websites.

Hint.css A tooltip library in CSS for your lovely websites Demo • Get started • Who's using this? • Browser support • FAQs • Contributing • License hi

Kushagra Gour 8.3k Jan 2, 2023
A Lightweight Responsive jQuery Tooltip Plugin

tipso A Lightweight Responsive jQuery Tooltip Plugin There is also a Wordpress version of this plugin. Get it here Getting started Include jQuery <scr

Bojan Petkovski 325 Dec 21, 2022
React tooltip is a React.JS Component that brings usefull UX and UI information in selected elements of your website.

React Tooltip ✅ React tooltip is a React.JS Component that brings usefull UX and UI information in elements of your website. Installation ⌨️ React Too

Marc Ramos 1 Dec 22, 2021
Cooltipz.css - A highly customisable, minimal, pure CSS tooltip library

Cooltipz.css - Cool tooltips Cool customisable tooltips made from pure CSS Lightweight • Accessible • Customisable • Simple Cooltipz.css is a pure CSS

Jack Domleo 110 Dec 24, 2022
Tippyjs - Tooltip, popover, dropdown, and menu library

Tippy.js The complete tooltip, popover, dropdown, and menu solution for the web Demo and Documentation ➡️ View the latest demo & docs here Migration G

James N 10.5k Dec 28, 2022