title: set cursor position DIV fixed center-bottom to target
body: <p>my questions is How to <strong>show div or box element</strong> with position fixed center-bottom to click target</p>
  
  <p>example :</p>
  
  <pre><code>&lt;p&gt;
    &lt;button class="target-show"&gt;target show&lt;/button&gt; 
    &lt;button class="target-show"&gt;target show&lt;/button&gt;
  &lt;/p&gt;
  
  &lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;
  &lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;
  
  &lt;div id="demo"&gt;&lt;/div&gt;
  
  &lt;p&gt;
    &lt;button class="hidden-div"&gt;hidden div&lt;/button&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>css :</p>
  
  <pre><code>p {
    text-align:center;
  }
  button {
    width : 50px;
  }
  #demo {
    display :none;
    padding : 25px;
    background : red ;
    width : 100px;
    height : 100px;
  }
  </code></pre>
  
  <p>jquery :</p>
  
  <pre><code>$(function() {
      $(".target-show").click(function(e) {
          var target  =   $('.target-show');
              var div         =   $('#demo');
        var left      = e.clientX - target.width()/2;
        var top       = e.clientY - target.height()/2;
          div.css({'position': 'absolute', 'left': left, 'top': top}).show();
      });
  
        $(".hidden-div").click(function() { 
                  $("#demo").hide();
          });
  });
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
      $(".target-show").click(function(e) {
       var target = $('.target-show');
     var div   = $('#demo');
        var left  = e.clientX - target.width()/2;
        var top   = e.clientY - target.height()/2;
          div.css({'position': 'absolute', 'left': left, 'top': top}).show();
      });
      
        $(".hidden-div").click(function() { 
         $("#demo").hide();
       });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>p {
    text-align:center;
  }
  
  button {
    width : 50px;
  }
  
  #demo {
    display :none;
    padding : 25px;
    background : red ;
    width : 100px;
    height : 100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;p&gt;
    &lt;button class="target-show"&gt;target show&lt;/button&gt; 
    &lt;button class="target-show"&gt;target show&lt;/button&gt;
  &lt;/p&gt;
  
  &lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;
  &lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;&lt;hr&gt;
  
  &lt;div id="demo"&gt;&lt;/div&gt;
  
  &lt;p&gt;
    &lt;button class="hidden-div"&gt;hidden div&lt;/button&gt;
  &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>