Posted by Leandro
2016-01-04

Hello, first of all thanks for this great utility! is really awsome... I got only one question, how can I center the tipbox position inside div container? I look into tclass.js.inc.php and I found the css style parameters, but positions parameters look a Little confusing for a newbie like me...

I should edit all this?

tip_box.css({
"position":"absolute",
"left":"-10000px",
"top":"-10000px"
});

tip_box.appendTo( $( 'body' ) );
tip_box.show();

wt = tip_box.outerWidth(false);
ht = tip_box.outerHeight(true);

var x = obj.offset().left;
var y = obj.offset().top;
var w = obj.width();
var h = obj.height();

var ytd = 10;
var xt = x + w/2 - wt/2;
var yt = y - ht;

var xm = 0;
var ym = 30;

...I really dont understand what all that code does..

Thanks!
Posted by Tom
2016-01-04

> I found the css style parameters,

Yes, you found the right file and pinpointed the right location!
To center the tipbox, replace the following lines,
var x = obj.offset().left;
var y = obj.offset().top;
var w = obj.width();
var h = obj.height();
with these lines:
var pobj = obj.parents(".poll-front,.poll-result");
var x = pobj.offset().left;
var y = obj.offset().top;
var w = pobj.width();
var h = pobj.height();
Now it should be centered.