Search code examples
jqueryiframetooltipqtipqtip2

Edge Detection with qTip2


I'm using qTip2. I thought it included screen detection - however, I am using the tooltip within an iframe, and it isn't working:

screenshot showing tooltip hidden under edge of iframe

I tried:

position: {
    adjust: {screen: true},
    my: 'bottom center',  // Position my top left...
    at: 'top center' // at the bottom right of...
},

It didn't work


Solution

  • The qTip2 plugin has a viewport option:

    position: {
        my: 'bottom center',  // Position my top left...
        at: 'top center', // at the bottom right of...
        adjust: {
            screen: true
        },
        viewport: $(window)
    },
    

    It fixes this scenario.