我有一点JavaScript问题.代码在Opera和Firefox浏览器中工作,但在Internet Explorer 8中没有.有人知道为什么吗?
function createbtn(object, inner) {
var hover = document.createElement("div");
hover.setAttribute("class", "myarea");
if (inner) {
hover.style.width = object.width - 16 + "px";
hover.style.height = object.height - 16 + "px";
hover.style.top = getposy(object) + "px";
hover.style.left = getposx(object) + "px";
} else {
hover.style.width = object.width + "px";
hover.style.height = object.height + "px";
hover.style.top = getposy(object) - 8 + "px";
hover.style.left = getposx(object) - 8 + "px";
}
}
Run Code Online (Sandbox Code Playgroud)
我只是在学习Javascript.任何反馈欢迎.西蒙