Tips: offset controlled by element.height

59 views
Skip to first unread message

campari

unread,
Sep 3, 2011, 6:47:18 AM9/3/11
to MooTools Users
Is it possible to set offset.y according to the heigt of current
tooltip?
I want to position the tooltip above the links. The content varied so
the heigt of the tooltip is different each time.

var oTips = new Tips($$('.sb_tooltip'), {
className: 'sb_tooltip',
fixed: true,
offset: {'x': -20, 'y': DYNAMIC_OFFSET(?)}
});

Thanks in advance

Andrea Dessì

unread,
Sep 3, 2011, 7:08:36 AM9/3/11
to mootool...@googlegroups.com
Hi, 

I've tried to do it in a jsfiddle,

but... the onShow event is fired just a while before the position is calculated and applyied.
so right know I think isnt possible.

right? :)

--
Andrea

Andrea Dessì

unread,
Sep 3, 2011, 7:13:32 AM9/3/11
to mootool...@googlegroups.com
oh and of course I'm talking about this line:

--
Andrea

Arieh Glazer

unread,
Sep 3, 2011, 8:18:44 AM9/3/11
to mootool...@googlegroups.com
I have filed a pull request for this issue:
https://github.com/mootools/mootools-more/pull/1019

Will basically allow you to supply functions instead of values for the offset property.

You can add your support to it if you wish :)

I actually think this is a good idea all around - it is done by other utilities (for example - Highcharts) and allows much more dynamic value assignments.
--
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il

Reply all
Reply to author
Forward
0 new messages