open modal window at present cursor position javascript

Solutions on MaxInterview for open modal window at present cursor position javascript by the best coders in the world

showing results for - "open modal window at present cursor position javascript"
Greta
09 Jun 2019
1 $(document).ready(function(){
2
3     $('html').click(function(e){
4      mouseX=e.pageX;
5      mouseY=e.pageY;
6      var bodyTop = document.documentElement.scrollTop + document.body.scrollTop;
7      ..
8      //window.outerWidth is not working in IE
9      var windowWidth  = $(window).outerWidth();
10      var windowHeight = $(window).outerHeight();
11      ..
12      if(mouseY-bodyTop+popupHeight > windowHeight)
13        ...
14        ...
15      //set the position first. remove the position attr in css   
16      $('div').css({position:"absolute",top:popupTop,left:popupLeft});
17      $('div').show();
18     });
19 });
20