title: Spin.js , append div (with absolute position) and spin it
body: <p>I'm using <a href="http://fgnass.github.io/spin.js/" rel="nofollow noreferrer">Spin.js</a></p>
  
  <p>What I would do is this: "append" a div (with absolute position) to another main-div and active Spin on it.</p>
  
  <h2>Javascript Code</h2>
  
  <pre><code>s+="&lt;div style='position:relative;margin-top:"+obj.top+"px;margin-left:"+obj.left+"px;width:180px;height:70px;background-image:url(img.png);' oggetto='1' id='id1'&gt;";
      s+="&lt;/div&gt;";
  
  $("#miodiv").append(s).spin();
  </code></pre>
  
  <h2>Html result of Append</h2>
  
  <pre><code>&lt;div style="position:absolute;margin-top:365px;margin-left:470px;width:180px;height:70px;background-image:url(img.png);" oggetto="1" id="id1"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The Spin is add to the div but not in the center , but in the middle of the page. </p>
  
  <p>I've seen questions like this on SO (<a href="https://stackoverflow.com/questions/23843817/insert-the-spin-js-spinner-into-a-div">...</a>), which gave as a solution adding <em>position:relative</em> to the div, but I have to keep <em>position:absolute</em>. </p>
  
  <p>Also if from the console of google chrome call: </p>
  
  <pre><code>$("#id1").spin(); 
  </code></pre>
  
  <p>the spin is successfully added to the center of div</p>
  
  <h2>UPDATE</h2>
  
  <p>Added <a href="http://jsfiddle.net/nicolomonili/5y0tkt2s/" rel="nofollow noreferrer">JSFIDDLE</a>, which represents in a simplified way my situation</p>