Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qTip viewport adjustment not working

I have solved this problem already, but I wanted to share it, as I can see alot of people are dealing with it, and not enough solutions are available.

qTip Viewport adjustments weren't working for me.

like image 420
André Snede Avatar asked Aug 12 '13 12:08

André Snede


1 Answers

First problem:

I had forgotten to include the library, when I first downloaded qTip: qTip Download page, remember Viewport Adjustment!

Second problem:
I hadn't setup it up right:
The simplest way of getting this functionality can be seen here:

// Create the tooltips only when document ready
 $(document).ready(function()
 {
     // MAKE SURE YOUR SELECTOR MATCHES SOMETHING IN YOUR HTML!!!
     $('.qtippy').each(function() {
         $(this).qtip({
             position: {
                    my: 'left top',
                    at: 'right center',
                    viewport: $(window)
                },
         });
     });

     $(".qtippy").draggable();
 });

Or play with it in this jsFiddle: http://jsfiddle.net/nM7AA/

like image 76
André Snede Avatar answered Oct 18 '22 22:10

André Snede