title: JQuery - Position Popup in relative to button(s)
body: <p>I'm trying to position a popup relative to its button or the button that is clicked with jquery. I'd like to position the popup in a way that doesn't cover up the button itself. Position it to the left, right, above or below the button that is clicked. </p>
  
  <p>Now I know I can do this by writing more html popups and css but there got to be a way to dynamically use one div and position it with jquery. I tried using offsets and position (at one point) but I couldn't get it to work. Frankly, I'm very entry level with js and jquery so forgive my noobness.</p>
  
  <p>Any help would be greatly appreciated!!</p>
  
  <p>JS:</p>
  
  <pre><code> $('.trends').click(function () {
       $('.questions').fadeIn();
       $('.question').html('&lt;p&gt;What trends could potentially drive growth in the U.S.?&lt;/p&gt;');
       /* if I add this and zero out the positioning via css the pop gets offset but its way far away from this parent.
       var offset = $(this).offset();
                  $('.questions').css('left',offset.left);    
                  $('.questions').css('top',offset.top);*/
  
   });
  
   $('.consumer').click(function () {
       $('.questions').fadeIn();
       $('.question').html('&lt;p&gt;Even though we have low inflation, consumers are not increasing their spending. Why?&lt;/p&gt;');
   });
  
   $('.industry').click(function () {
       $('.questions').fadeIn();
       $('.question').html('&lt;p&gt;What factors drove crude oil prices to fall and which industries benefited?&lt;/p&gt;');
   });
  
   $('.henn').click(function () {
       $('.questions').fadeIn();
       $('.question').html('&lt;p&gt;MESSAGE FROM OUR PRESIDENT&lt;/p&gt;');
       var offset = $(this).offset();
   $('.question').html('&lt;p&gt;What trends could potentially drive growth in the U.S.?&lt;/p&gt;');
  
   });
   $('.equity').click(function () {
       $('.questions').fadeIn();
       $('.question').html('&lt;p&gt;The U.S. stock market has been rising for more than six years. What do you see ahead for equities?&lt;/p&gt;');
   });
  
   $('.balance').click(function () {
       $('.questions').fadeIn();
       $('.question').html('&lt;p&gt;what does it look like for companies balance sheets?&lt;/p&gt;');
   });
  
  
   $('.close').click(function (e) {
       e.stopPropagation();
       $(this).parent().hide();
       $('.items').removeClass('no-effect');
  
   });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/nick1572/3d7v0o25/30/" rel="nofollow">jsFiddle</a></p>