我有一个我构建的函数(目前还很简单),但是我找不到如何在它展开 onMouseOver 时移动对象,这样它就不会移动页面上的其他对象,是吗?可能吗?
function expandbox(x) {
x.style.height = "100px";
x.style.width = "100px";
}
function returnbox(x) {
x.style.height = "80px";
x.style.width = "80px";
}
最佳答案
使元素在相对容器内相对定位,然后更改其尺寸。
确保给它更高的 z-index。
将其放置在 style
的 left,right,top,bottom
属性中。
关于javascript - 在 JavaScript 中将位置移动到 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16031200/