Move this topic
How to address the activated tooltip?
in Using jQuery UI
•
8 years ago
Hello,
I'm looking for a way to address the shown tooltip on the open-event.
I'm looking for a way to address the shown tooltip on the open-event.
- $(document).tooltip({
- open: function(event, ui){
- $(WHATEVER).css("color","red"); // for example
- }});
Actually I want to store the last shown tooltip in a global variable to address it from another function.
I tried it with "this" and "event.target", but it doesn't really work.
Any suggentions?
Ciao
hasenpfote
1
Replies(5)
Re: How to address the activated tooltip?
8 years ago
http://james2013.batcave.net/getting_title_jquery_tooltip.htm
View the above source and the output is in console.log
Jim
View the above source and the output is in console.log
Jim
Leave a comment on coldfusionguy's reply
Re: How to address the activated tooltip?
8 years ago
Thank you for the quick answer. Unfortunatly I am not looking for the value of the tooltip but for the object the tooltip belongs to. (As I read my question again I have to admit, that it was not clear enough.)
My intention is to close the last opened tooltip manually. As far as I can see jQueryUI-tooltips opens by two events: mouseover and (for accessiblity-reasons) focusin. So it could be possible that a user opens a tooltip by a tabstop (which stays open until the html-object lost its focus) and then he opens another tooltip by a mouseover. The result are two opened tooltips at the same time. To avoid that, I want to close the last opened tooltip before opening another one.
The idea was something like this:
var globalVariable = false;
-
$(document).tooltip({
-
open: function(event, ui){
globalVariable.tooltip('close'); // the last one
-
globalVariable = HERE-IS-THE-PROBLEME; // the active one (something like „this“)
-
}});
The alternative would be to close all tooltips before opening a new one.
Leave a comment on hasenpfote's reply
Re: How to address the activated tooltip?
8 years ago
Referring to your original post, you would need to write something like:
- $(document).tooltip({
- open: function(event, ui){
- $( ui ).css("color","red"); // for example
- }
- });
Check out the Tooltip Widget | jQuery UI API Documentation.
Leave a comment on Godsbest's reply
Re: How to address the activated tooltip?
8 years ago
I now understand what you want here is the code link below:
http://james2013.batcave.net/tooltips_and_keyboard.htm
If you do a tab or a shift tab and hover, you only see one tooltip at a time
Jim
http://james2013.batcave.net/tooltips_and_keyboard.htm
If you do a tab or a shift tab and hover, you only see one tooltip at a time
Jim
Leave a comment on coldfusionguy's reply
Re: How to address the activated tooltip?
8 years ago
@coldfusionguy
This is exactly for what I am looking for.
This is exactly for what I am looking for.
I have read it in the jQueryUI-api-doc, but
obviously haven't understood it.
In the future I should watch more carefully at "Type: jQuery".
Many thanx.
Hasenpfote
Leave a comment on hasenpfote's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic
Reply to hasenpfote's question
Statistics
- 5 Replies
- 3075 Views
- 2 Followers