使用 JavaScript,我们可以设置元素的相对位置,例如:
object.style.position = "absolute" || "fixed" || "relative"
console.log(object.style.position)
时,它不会返回应用于对象的位置 - 它返回 null
。我是否遗漏了什么,或者还有其他方法可以实现我试图实现的功能?
get
对象的样式(但你可以set
它)。请参见我在此处的其他答案:http://www.stackoverflow.com/questions/10919859/javascript-animation-is-not-runing/10920445 - Alexandre Khoury