JavaScript jquery tooltip should change position when offscreen

on window scrolling the Tooltip should appear correctly above/below/left/right of its parent. Once I scrolled down on my Demo the position of the Tooltip brakes.

How can I calculate the y-offset of the parent and display the tooltip in the right position? I'm nearly there, not sure what is missing. http://fiddle.jshell.net/j7MWE/

 $.fn.tooltip = function () {
     var $el = $(this);
     var $w = $(window);
     var timer;
     var delay = 500;

     $el.mouseenter(function (e) {
         timer = setTimeout(function () {
             var $c = $(e.currentTarget);
             var $tt = $('<div class="tooltip fade right"><div class="arrow"></div><h3 class="popover-title" style="display: none;"></h3><div class="popover-content"><article class="default"><h1>Anchorman 2: The Legend Continues</h1><ul><button>£10.99 Buy</button><button>£3.49 Rent</button><p>Hilarious comedy sequel starring Will Ferrell and Steve Carell.</p></article></div></div>').appendTo($(e.currentTarget).closest('.item')).fadeIn(300);

             $tt.toggleClass('horiz-offscreen', $w.width() < $tt.outerWidth() + $tt.offset().left);
             if ($w.height() < $tt.outerHeight() + $tt.offset().top) {
                 $tt.css('top', $w.scrollTop() + $w.height() - $c.position().top - $tt.outerHeight());
             }
         }, delay);
     });

     $el.mouseleave(function (e) {
         $('.tooltip', e.currentTarget).fadeOut(500, function () {
             $(this).remove();
         });
         clearTimeout(timer);
     });

 };

 $('.item').tooltip();
Answer:1

I have the following canvas: Codepen link What I want: Equal margin on both sides of canvas without any horizontal scroll bars. Problem: margin-right property does not to work. I have seen some ...

I have the following canvas: Codepen link What I want: Equal margin on both sides of canvas without any horizontal scroll bars. Problem: margin-right property does not to work. I have seen some ...

  1. margin-right not working
  2. margin right not working css
  3. margin right not working react native
  4. margin right not working android
  5. margin right not working bootstrap
  6. margin-right not working in chrome
  7. margin-right not working in ie
  8. margin right not working in outlook
  9. margin right not working on div
  10. margin right doesn't work
  11. margin-right auto not working
  12. margin-right negative not working
  13. margin right 0 not working
  14. margin right minus not working
  15. margin-right auto not working in ie
  16. html margin right not working
  17. table margin right not working
  18. ionic margin-right not working
  19. margin-right negative value not working
  20. body margin right not working

I need to convert megabytes to the appropriate unit. parseInt(10000) * 1024 * 1024 //10485760000 byte filesize(parseInt(10000) * 1024 * 1024); // "9.77 GB" 9.77 GB seems to be wrong. When I convert ...

I need to convert megabytes to the appropriate unit. parseInt(10000) * 1024 * 1024 //10485760000 byte filesize(parseInt(10000) * 1024 * 1024); // "9.77 GB" 9.77 GB seems to be wrong. When I convert ...

  1. bytes human readable
  2. bytes human readable online
  3. bytes human readable javascript
  4. java byte human readable
  5. bytes to human readable python
  6. golang bytes human readable
  7. bytes to human readable bash
  8. bytes to human readable php
  9. bytes to human readable c#
  10. bytes to human readable calculator
  11. postgres bytes human readable
  12. byte array to human readable string
  13. java byte size human readable
  14. human readable byte count
  15. python format bytes human readable
  16. javascript format bytes human readable
  17. golang format bytes human readable
  18. python print bytes human readable
  19. c# format bytes human readable
  20. java format bytes human readable

I'm trying to crete 3 HTML collections containing all my links on a page, so I can attach 3 separate function to each categories of links. My first HTML collection is "header links", the second is "...

I'm trying to crete 3 HTML collections containing all my links on a page, so I can attach 3 separate function to each categories of links. My first HTML collection is "header links", the second is "...

  1. remove items from list python
  2. remove items from array javascript
  3. remove items from list
  4. remove items from amazon history
  5. remove items from startup windows 10
  6. remove items from apple wallet
  7. remove items from launchpad
  8. remove items from dictionary python
  9. remove items from icloud
  10. remove items from kindle library
  11. remove items from list c#
  12. remove items from etsy cart
  13. remove items from menu bar mac
  14. remove items from dock
  15. remove items from google search
  16. remove items from google drive
  17. remove items from photos
  18. remove items from pictures
  19. remove items from buy again amazon
  20. remove items from quick access

I wanted to have a way so users can choose images to send with a review. so I use dropzone.js . It seems like having problems sending multiple images in one request. I thought that req.files would ...

I wanted to have a way so users can choose images to send with a review. so I use dropzone.js . It seems like having problems sending multiple images in one request. I thought that req.files would ...

  1. error unexpected field multer
  2. error unexpected field
  3. error unexpected field at makeerror
  4. multer error unexpected field postman
  5. multer error unexpected field node js
  6. nodejs multer error unexpected field
  7. node multer error unexpected field
  8. express multer error unexpected field
  9. npm multer error unexpected field
  10. error unexpected value for instancetype field
  11. jq error syntax error unexpected field
  12. syntax error unexpected parseop_field
  13. multer error unexpected field at wrapped filefilter