Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么理由
$("#cloud").top(100).left(100);
不起作用,尽管事实上
$("#cloud").height(Math.random()*55).width(Math.random()*55);
和
#cloud { top:100px; left:100px; }
工作正常吗?
top 和 left 是 CSS 属性,因此应该分配给.css()函数。
.css()
$("#cloud").css({ "top" : "100px", "left" : "100px" });