GithubHelp home page GithubHelp logo

tip's Introduction

Tip

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

js tip component js tip with markup

js maru

Installation

$ npm install tip-component

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.

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

new Tip(content)

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 ianstormtaylor avatar lancejpollard avatar matthewmueller avatar retrofox avatar rauchg avatar dominicbarnes avatar fredsterss avatar defunctzombie avatar tootallnate avatar coreh avatar lauramelos avatar forbeslindesay avatar cristiandouce avatar jb55 avatar swatinem avatar anthonyshort avatar

Stargazers

曹文忠 avatar  avatar Nicolas Renon avatar Stanley Shyiko avatar Vincent Voyer avatar Matthew Palmer avatar

Watchers

Julian Gruber avatar Prakash Durgani avatar James Cloos avatar Achille avatar Andrius Vaskys avatar Julien Fabre avatar Francisco Alberini avatar George Wolf avatar Rakesh Nair avatar Gurdas Nijor avatar Brantley Beaird avatar  avatar Karthick Sriraman avatar  avatar Niels avatar  avatar Sam Johnson avatar  avatar  avatar Sherry Chao avatar Jenn Boyce avatar Michael Phillips avatar Christopher Albanese avatar Brent Summers avatar  avatar Alex Noonan avatar Teresa Nesteby avatar Chris Nixon avatar  avatar  avatar Zeb avatar Stephanie Evans avatar Liz Hartmann avatar Arlen McCluskey avatar  avatar Hannah avatar Ian Muceus avatar  avatar Emilio Gomez Lavin avatar  avatar Kate Flaming avatar  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.