【发布时间】:2012-06-06 10:55:53
【问题描述】:
我知道标题可能有点令人困惑(我不知道该怎么问这个问题)所以这是我正在处理的示例。
http://beautifulcreationphotography.net/gallery.html
所以我的问题是,当您将鼠标悬停在图像上时,其他图像会在图像放大时四处移动。一种可能的解决方案是使用绝对定位,但在网格中手动定位所有图像非常麻烦(我希望将其设为 3 列宽的网格)。
还有哪些其他解决方案可以帮助解决这个问题?我对纯 javascript 解决方案以及使用 JS 库都持开放态度。
HTML: http://pastebin.com/pfuRppdY
JS: http://pastebin.com/9m7TwNXU
CSS:
#gallery {
display:inline;
margin:50px;
height:300px;
}
#gallery img {
position:relative;
width:200px;
margin:30px;
}
【问题讨论】:
标签: javascript html css web