GithubHelp home page GithubHelp logo

ykankaya / tipit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from busticated/tipit

0.0 1.0 0.0 108 KB

jQuery plugin to provide clean and simple tooltips that won't gunk up yr html

JavaScript 77.98% HTML 11.03% CSS 10.99%

tipit's Introduction

jQuery tipIt Plugin - v0.1.0

Clean and simple toolTips ya'll! (yep, another one :-)

NOTE: This is pre-release software under active development! Not intended for use in production (yet)!

NOTE NOTE: Demo coming soon(ish)!

Overview

TipIt provides quick and easy toolTips without gunking up your site with extraneous markup. Tips share a single container element, tip content is easily configured via "data-tip" attributes, and tips automatically detect the screen's edge and update their display accordingly. Plus: Fully skin-able via plan ol' CSS!

###highlights:###

  • Edge detection!
  • Delay tip display
  • Small footprint!
  • Customizable via regular ol' css and js!
  • Works in IE7-9 and the reasonable browsers too!

Usage

###setup### For any element you'd like to show a tooltip for, simply assign a target classname then include a data attribute with the content of your tip. Like this:

<a href="http://github.com" class="tip" data-tip="Secure source code hosting and collaborative development">example tooltip</a>

###basic###

//initialize your target elements
$("a.tip").tipIt();

###advanced###

//configuration options
$("a.tip").tipIt({
    id : "tmpl-ToolTip", //the id to assign to tipIt's container element
    container : "tipContainer", //css class to assign to container
    content : "tipContent", //css class to assign to content element
    right : "tipR", //css class assigned when standard tip is shown
    left : "tipL", //css class assigned when flipped tip is shown
    arrowR: "arrowR", //css class to assign to right-pointing arrow
    arrowL: "arrowL", //css class to assign to left-pointing arrow
    delay : 200 //delay in ms before tip is shown
});

###support files###

CSS
To display tips, tipIt merely drops css class names on to its container element and assigns a position. As such, you'll need to include the appropriate css rules in your project. Here's the basic ruleset:

.tipContainer {
  display: none;
  position: fixed;
  top: 0px;
  z-index:9997;
}
.tipContainer.tipR,
.tipContainer.tipL {
  display:block;
}
.tipContent {
  display:block;
  padding: 5px;
  background: #000;
  background:rgba(0,0,0,0.7);
  color: #fff;
  font: bold 12px/10px arial;
  text-align: center;
  text-indent: 0;
  text-transform: none;
  text-shadow:none;
  vertical-align: 1px;
}
.tipR .tipContent {
  -webkit-border-radius: 0 3px 3px 0;
  -moz-border-radius: 0 3px 3px 0;
  border-radius: 0 3px 3px 0;
}
.tipL .tipContent {
  -webkit-border-radius: 3px 0 0 3px;
  -moz-border-radius: 3px 0 0 3px;
  border-radius: 3px 0 0 3px;
}
.arrowR,
.arrowL {
  display:none;
  position:absolute;
  content: ".";
  text-indent:-9999px;
  border-style: solid;
  border-width: 10px;
  width: 0;
  height: 0;
  pointer-events:none;
  top:0;
}
.tipR .arrowR {
  display:block;
  left:-20px;
  border-color: transparent #000 transparent transparent;
  border-color: transparent rgba(0,0,0,0.7) transparent transparent;
}
.tipL .arrowL {
  display:block;
  right: -20px;
  border-color: transparent transparent transparent #000;
  border-color: transparent transparent transparent rgba(0,0,0,0.7);
}

License

jQuery tipIt Plugin
Copyright (c) 2011 Matthew Mirande
Dual licensed under the MIT or GPL Version 2 licenses.

tipit's People

Contributors

busticated avatar

Watchers

 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.