Code Monkey home page Code Monkey logo

simptip's Introduction

Simptip [v1.0.4]

A simple CSS tooltip made with Sass

Installation

Install with npm, Yarn or Bower:

npm:

npm install simptip --save

Yarn (note that yarn add automatically saves the package to the dependencies in package.json):

yarn add simptip

Bower:

bower add simptip --save

Usage

I'll explain with an example:

<link rel="stylesheet" type="text/css" href="simptip-mini.css" />

or:

<link rel="stylesheet" type="text/css" href="simptip.css" />

Then you can do something like this:

<span class="simptip-position-top" data-tooltip="Tooltip's content"> Text </span>

What you see in the data-tooltip attribute is the text content of the tooltips, and the value of class attribute is tooltop's position.

You can use .simptip-position-right , .simptip-position-bottom and .simptip-position-left class for other positions that you would like.

You can also use more features of Simptip by adding these classes:

  • .half-arrow : change tooltip's arrow to half arrow
  • .simptip-smooth : makes soft edge for tooltip
  • .simptip-fade : fades effect for show/hide
  • .simptip-movable : shows movable effect
  • .simptip-multiline : makes multiline body for tooltip
  • .simptip-success : changes color to green spectrum
  • .simptip-info : changes color to blue spectrum
  • .simptip-warning : changes color to orange spectrum
  • .simptip-danger : changes color to red spectrum

License

Copyright (c) 2013 @arashmanteghi

Licensed under the MIT license.

simptip's People

Contributors

arashmanteghi avatar nilswindisch avatar scottaohara avatar stevenschobert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simptip's Issues

Tooltip on input:text focus

Hi Arash,

Thank you very much for this clean solution (no js is a big plus for me).

I've been trying to add a tooltip to an input text (instead of placeholder), but it looks like it doesn't work (Fx 22), despite the :focus rules in the code. Im using multiline mode.

According to that snippet:

   [data-tooltip]:hover:before, [data-tooltip]:hover:after, [data-tooltip]:focus:before, [data-tooltip]:focus:after {
      visibility: visible;
      opacity: 1;
    }

I think it should at least show up.

Have you got any idea/suggestion what i could be doing wrong? (I tested on div/span and tooltips are working perfectly).

Regards,
Paweł

Tooltip on Image Hover

Hi Arash,

Thanks for the nice tooltip. Is is possible to apply the tooltip on image hover? I used it but unfortunately not working.

Thanks.

Namespacing

I think it’s better to namespace your code and use OCSS. like this:

<span class="simptip simptip--position-top simptip--half-arrow"></span>

this way, it’s easier to read and you wont have any conflicts with other styles and scripts.

Not work with js

var arr = new Array();
$("*").each(function(){
arr = $(this).attr("title");
if($(this).attr("title") !== undefined){
var t = $(this).attr("title");
$(this).addClass('ttt').removeAttr("title").attr('data-title',t);
}
});

and tt not show Oo, your css is on the page.

Bower doesn't install

In v1.0.2 bower.json is still broken.
Please add a new tag so the project can be installed with bower.
Thanks

Install via npm

Could you add package.json to install it via npm?
Seems, otherwise it's impossible to do. Here is a link on correspondent ticket.

[enhancement] Add missing bower.json.

Hey, maintainer(s) of arashmanteghi/simptip!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library arashmanteghi/simptip is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "arashmanteghi/simptip",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Remove filter: blur from $multiline

Would recommend removing the filter blur declarations for the @if $multiline == true rules as the performance hit on the the iPad affects the rendering of the text inside the tooltip.

Also, can't really any other reason as to why it's there anyway unless I've missed something?

Compatibility info needed

Would be really handy, if you include compatibility info in the documentation. Like what browsers are guaranteed to support the plugin.

Add link inside tooltip

Hello there!

Is it possible to place a link inside the tooltip, like

<span class="simptip-position-right simptip-movable simptip-multiline simptip-info" data-tooltip="To view this file you need the free Adobe Acrobat Reader. Click to open.">

Greetings from Germany!

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.