我的以下代码无法使微调器始终显示在屏幕中央。有人可以帮我吗?
var div = document.createElement("div");
div.id="create";
div.style.top="50%";
div.style.left="30%";
div.style.width = "100px";
div.style.height = "100px";
div.style.background = "white";
div.style.color = "blue";
div.innerHTML = "please wait while your request is processed.";
div.style.zIndex="5";
div.position="fixed";
div.style.margintop="-9em";
div.style.marginleft="-15em";
document.getElementById('center').appendChild(div);
ams.showSpinner( {
element: $('create'),
opacity: 0.3,
duration: 0.3
} );