Setting title and text of a tooltip

34 views
Skip to first unread message

Roo

unread,
Feb 6, 2015, 5:44:42 AM2/6/15
to mootool...@googlegroups.com
Hi all,

I have a bunch of elements with tooltips. You click these elements to do some work and I wish to PERMANENTLY update the tip text and title to reflect the change.

So far I have been able to set the text and title of the visible tip using;

myTips.text('Whatever')
myTips.title('Whatever')

However I have not been able to permanently reset this and once you lose focus and regain focus the old title and text is used. I have tried detaching the tip, editing the title and rel for the element and then reattaching the tip but I am guessing that it has this in an array somewhere and is using that array when the element is reattached.

Any ideas..?

Fiddle here to show trying to detach and attach tips



Rolf

Tim Wienk

unread,
Feb 6, 2015, 6:56:45 AM2/6/15
to mootool...@googlegroups.com
You'll want to use the Element Storage if you're changing the tips'
contents after they're attached. When the tips are attached once, the
used title and text are stored in MooTools' Element Storage. How to
use it is described here:

http://mootools.net/more/docs/1.5.1/Interface/Tips#Tips:Storage

Which, in your example, would end up being:
http://jsfiddle.net/nb7ofhgc/1/


On 6 February 2015 at 11:44, 'Roo' via MooTools Users
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "MooTools Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mootools-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Roo

unread,
Feb 6, 2015, 11:44:29 AM2/6/15
to mootool...@googlegroups.com
Thank you, worked perfectly,,,I didnt realise the store was for storing changed titles and text as well I thought it was just for creating the tips in the first instance.

Thanks
Rolf
Reply all
Reply to author
Forward
0 new messages