Search code examples
javascriptqtip2

qTip2: how to make a tooltip move to left when a link is close to the right side of the browser?


I am using qTip 2.0.1 for displaying tooltips.

I make the tooltip show up in the bottom right of a link. The issue is that when the link is close to the right side of the browser, the tooltip box looks squeezed and ugly.

Can I configure qTip to make it auto-adjust its tooltip position to bottom-left?


Solution

  • You can use the collision detection as demonstrated on their demo:

    position: {
            at: $('#at').val(),
            my: $('#my').val(),
            viewport: $(window),
            adjust: {
                method: [your method]
            }
        },
    ...
    

    Documentation