I'm using Spin.js
What I would do is this: "append" a div (with absolute position) to another main-div and active Spin on it.
Javascript Code
s+="<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'>";
s+="</div>";
$("#miodiv").append(s).spin();
Html result of Append
<div style="position:absolute;margin-top:365px;margin-left:470px;width:180px;height:70px;background-image:url(img.png);" oggetto="1" id="id1"></div>
The Spin is add to the div but not in the center , but in the middle of the page.
I've seen questions like this on SO (...), which gave as a solution adding position:relative to the div, but I have to keep position:absolute.
Also if from the console of google chrome call:
$("#id1").spin();
the spin is successfully added to the center of div
UPDATE
Added JSFIDDLE, which represents in a simplified way my situation