Giter VIP home page Giter VIP logo

minitip's People

Contributors

goldfire avatar href 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

minitip's Issues

Ajax

may be possible to use ajax without any code changes - I haven't tested this yet, but something like this might work:
(pseudocode)

show: function(content){
if (content.html() == "") {
$.get("/ajax.html", function(html){
content.html(html);
});
}
}

Get target element in content callback?

I need to generate my tooltip content dynamically based on some attributes of my target element. Here is my code:

<div class="tooltip" data-image="true" data-content="test 123">Hover over me</div>

<script>
$(function(){
  $('.tooltip').miniTip({
    content: function(){
      console.log(this);
      console.log($(this));
    }
  });
});
</script>

Is it possible to somehow get the jQuery object of the div being hovered over in my content callback?

option for no event

i'd like to show tooltips and hide them programatically. would be awesome if it didn't need an event, and i could give it a delay until it should be hidden.

"Sticky" Tool-Tips

This is a great plugin. I have been working on making sure all my fellow developers know of it and are using it.

I am working on building a site that will be viewed on tablets only. Thankfully there is the click option for making the tip appear and I know it will disappear when you click another link that is connected to a tip or click on the original link. What I am wondering is, would it be possible to add an option to close the tip by clicking on it in addition to all the other ways currently available? The design I am working with shows an "X" on each tool tip and they are really looking forward to being able to click that to close it, but clicking anywhere on the tool top would be fine.

Cheers,
Matt

Time Delayed Closing

Hi James,

I am trying to set a function using the show option that would automatically close the tool tip that was just opened after 3 seconds. Unfortunately, I am not having any luck. Here are the trials I made. Do you have any suggestions?

$('#image-01').miniTip({
    anchor: 'e',
    content: 'CONTENT',
    event: 'click',
    offset: -300,
    show: function () {
        $('#image-01').delay(3000).miniTip({hide: true})
    }
});
$('#image-01').miniTip({
    anchor: 'e',
    content: 'CONTENT',
    event: 'click',
    offset: -300,
    show: function () {
        function hideTip() {
            $('#image-01').miniTip({doHide: true});
        };
        setTimeout(hideTip(), 3000);
    }
});

Thank you,
Matt

Refresh Function

First off, this is a fantastic plugin...lightweight and straight to the point.

I am trying to use it with dynamic content and am having an issue with re-initializing it. I have some color swatches that are re-drawn whenever one of them is clicked (this is due to server-side functions to check availability of the chosen swatch). On initial load, the tool tips show as expected. However, after the re-draw, the tool tip function no longer is associated with the swatches. Can a reload or refresh option be added into the plugin so it can deal with dynamic or AJAX driven content?

Using miniTip with an image map

When I try and use an image map to fire a tool tip, I am getting the following error: "num is not defined in jquery.miniTip.js line 181". I have tried using both circle and rectangular areas.

Cheers,

Matt

Dynamically destroy miniTip binding?

I need to be able to remove already bound miniTips.

Is there any way to dynamically destroy a miniTip binding? Similar to the way in which you would use .unbind and .die with .bind and .live respectively.

New elements in the DOM

If new elements are inserted into the DOM, they don't get the miniTip binding as they should.

race condition when aHide is false and event is hover

context

several same-sized divs with float:left.
each div have a minitooltip associated with aHide set false.

step to reproduce

  1. when the cursor is over a div a tooltip appears.
  2. move the cursor from the div to the tooltip

explanation

when the cursor move from the div to the tooltip, the cursor may raise an event on visible part of the div under the tooltip.

| tooltip |
+---/----+
.....v....... <- this space is the danger zone because this div's tooltip raise randomly an hover event when the cursor is detected on it.
+---------+
| div |

demonstration code

<style>body p{float:left;border:1px solid #000;width:200px;height:200px;margin:0}</style>
<p></p><p></p><p></p><p></p><p></p><p></p>
<p></p><p></p><p></p><p></p><p></p><p></p>
<p></p><p></p><p></p><p></p><p></p><p></p>
<script>
$(document).ready(function(){$("p").each(function(i,e){var t = $(this);t.miniTip({aHide:false,event:'hover',content:'['+i+']'});
});});</script>

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.