Materialize: Programmatically launching tooltips

Created on 9 Jun 2015  路  5Comments  路  Source: Dogfalo/materialize

Is there a method to have tooltips display programmatically? trying to solve a use case where tooltips are applied on a floating action button ala google but on mobile devices the tooltip will only launch once the button it belongs to is clicked. Would be great if pressing or hovering on the floating action button would trigger the tooltips to display and once again on click/mouse out of the main floating action button destroy the tooltips.

Tooltip question

Most helpful comment

Using jQuery you can programmatically trigger the _mouseenter.tooltip_ using _trigger()_ function.

$(".tooltip").trigger("mouseenter.tooltip");
setTimeout(function(){$(".tooltip").trigger("mouseleave.tooltip");}, 2000);

That is assuming the tooltip has been initialized with required values before triggering the events.

All 5 comments

any updates on this? I'm looking for similar functionality.

I ended up ditching materialcss for the tooltips and downloaded the tooltips included in bootstrap 3 to get to what I need. Hopefully in the future materialcss will provide the functionality.

Using jQuery you can programmatically trigger the _mouseenter.tooltip_ using _trigger()_ function.

$(".tooltip").trigger("mouseenter.tooltip");
setTimeout(function(){$(".tooltip").trigger("mouseleave.tooltip");}, 2000);

That is assuming the tooltip has been initialized with required values before triggering the events.

How an i Use jQuery to programmatically destroy a tooltip after triggering it? ..i have a situation here its left hanging around the screen after the button its showing is clicked and it hits window.location to download a file, i think the window.location is messing with the tooltip so its not destroyed.

please help :-) and thanks

open method added in v1-dev branch

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samybob1 picture samybob1  路  3Comments

cope picture cope  路  3Comments

heshamelmasry77 picture heshamelmasry77  路  3Comments

MickaelH974 picture MickaelH974  路  3Comments

artur99 picture artur99  路  3Comments