GithubHelp home page GithubHelp logo

isabella232 / tip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/tip

0.0 0.0 0.0 170 KB

Tooltips with a nice flexible API

Home Page: http://component.github.io/tip/

Makefile 1.14% JavaScript 68.27% HTML 28.88% CSS 1.71%

tip's Introduction

Tip

Tip component. Inspired by tipsy without the weird jQuery API.

js tip component js tip with markup

js maru

Live demo is here.

Installation

$ npm install component-tip

Features

  • events for composition
  • "auto" positioning on window resize / scroll
  • fluent API

Events

  • show the tip is shown
  • hide the tip is hidden

API

Tip(el, string)

Equivalent to Tip(el, { value: string }).

Tip(el, [options])

Attach a Tip to an element, and display the title attribute's contents on hover. Optionally apply a hide delay in milliseconds. Also if static is true the tip will be fixed to its initial position.

var tip = require('tip');
tip('a[title]', { delay: 300 });

new Tip(content, [options])

Create a new tip with content being either a string, html, element, etc.

var Tip = require('tip');
var tip = new Tip('Hello!');
tip.show('#mylink');

Tip#position(type, [options])

  • top
  • top right
  • top left
  • bottom
  • bottom right
  • bottom left
  • right
  • left

Options:

  • auto set to false to disable auto-positioning

Tip#show(el)

Show the tip attached to el, where el may be a selector or element.

Tip#show(x, y)

Show the tip at the absolute position (x, y).

Tip#hide([ms])

Hide the tip immediately or wait ms.

Tip#attach(el)

Attach the tip to the given el, showing on mouseover and hiding on mouseout.

Tip#effect(name)

Use effect name. Default with Tip.effect = 'fade' for example.

Themes

License

MIT

tip's People

Contributors

tj avatar tootallnate avatar pirxpilot avatar retrofox avatar ianstormtaylor avatar swatinem avatar blowery avatar matthewmueller avatar rauchg avatar bmcmahen avatar fredsterss avatar dominicbarnes avatar dy avatar jb55 avatar cristiandouce avatar forbeslindesay avatar jkroso avatar lauramelos avatar coreh avatar defunctzombie avatar

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.