I want to change tooltip position when tooltip opened to upward.
qtip2 init;
jQuery('.tip').each(function(){
jQuery(this).qtip({
position: {
at: 'center center',
my: 'top center',
adjust: {
y: 15,
method: 'shift flip'
},
viewport: $(window)
},
show: { delay: 500 },
hide: { fixed: true, delay: 300, leave: false }
});
});
My init code as above and when hover over to element, it show as below for downward tooltip;
it's ok but, it shows as below for upward tooltip
I want it show as like this;
How can i?
It seems to me that flip
is a wrong option to use in this case. Using flipinvert
instead of flip
makes the positions right :
adjust: {
y: 15,
method: 'shift flipinvert'
}
It also positions right when not defining method
at all :
adjust: {
y: 15
}
forked fiddle -> http://jsfiddle.net/v68su257/
The docs says :
The default "flip" type basically flips the tooltip when it goes off-screen i.e. from top-right, to bottom-right etc. The "flipinvert" type works the same way, except when the flip happens it inverts the adjust.x and adjust.y properties.