Git Product home page Git Product logo

Comments (2)

calebjacob avatar calebjacob commented on June 24, 2024

As of right now, the only way to guarantee images will display correctly in tooltips is to explicitly set the images width and height. Without setting the image's dimensions, the plugin can't calculate the tooltip size since the image hasn't been loaded yet.

If you'd like to set up a JSFiddle with what you were trying before, I'd be happy to take a look at it.

Thanks!

from tooltipster.

BenRacicot avatar BenRacicot commented on June 24, 2024

Glad to see this here. (I tried to reproduce the error - http://jsfiddle.net/WebEnvelopment/xu3qE/1/ )
Anyways, I have my html setup like the Fiddle and this:

<div id="kalapanapos" class="tooltip" 
     title="<img src='http://farm8.staticflickr.com/7285/8737644017_b215ba8378.jpg' 
     alt='' width='100' height='100'/>"

        <a rel="tooltip" href="#" title="k">
            <img src="http://farm8.staticflickr.com/7285/8737656997_264ef696ba_t.jpg"/>
        </a>
</div>

However, the tooltips still open on first rollover off of their position, without an image and even upside down...
or
load-error1

Here is the current window.load JS (same TT problems) that I'm trying to get working. What am I missing?! Thanks in advance.

(function ($) { $(document).ready(function(){

$('.tooltip').tooltipster({
    animation: 'grow',
    maxWidth: 100
});

// on window load, show the tooltip
$(window).load(function() {
   $('#kalapanapos').tooltipster('show');

    // once a key is pressed on your keyboard, hide the tooltip
     $(window).keypress(function() {
     $('#kalapanapos').tooltipster('hide');
    });
});

I'm way to new at JS to say but maybe something with:
functionBefore:
Create a custom function to be fired before the tooltip launches. See the advanced section to learn more. Default: function(origin, continueTooltip) { continueTooltip(); }

A function to add the TTs to the DOM onLoad? Sorry for the greenery.

from tooltipster.

Related Issues (20)

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.