Aadi
Aadi

Reputation: 7109

Create tooltip using Mootools

How to create a Mootools tooltip information while focus on a text feild like http://vadikom.com/demos/poshytip/#form-tooltips

Thanks

Upvotes: 1

Views: 1273

Answers (3)

lorenzo-s
lorenzo-s

Reputation: 17010

You may find this useful:

http://mootools.net/forge/p/floatingtips

It's a plugin I developed some time ago. You can see a demo using it for text fields focus here:

http://jsfiddle.net/X37C9/

It works with Mootools 1.4 and 1.3.

Upvotes: 2

anna mae
anna mae

Reputation: 106

I made very minor adjustments to an old script by Ryan J.Salva corresponding to your request:

http://jsfiddle.net/ghazal/K7uaQ/

PS : changes commented and only for mootools 1.4.2 with compatibility. Hope it'll help.

Upvotes: 1

Oskar Krawczyk
Oskar Krawczyk

Reputation: 3502

There are various ways to achieve something like this.

The simplest would be to create a hidden element after the field, once you focus a field, fetch the element with the tooltip, and animate the position and opacity with Fx.Morph. On blur do the opposite.

Another way would be to create a single element at the bottom of the page, then fetch the position of each field with getCoordinates, adjust the position of the tooltip, inject the tooltip text from, say a data-tooltip property of the input, animate it to appear.

Using JsFiddle to prototype a solution would be the easiest.

Upvotes: 1

Related Questions