javascript - 我的元素显示在不同窗口大小的不同位置。如何定位?

标签 javascript jquery css

看看我的网站:http://homegym.sg/index.php/weight-tree-rack.html

如果您将鼠标悬停在产品图片下方的“更多 View ”字样上,则会出现一个附加图片框。通常它通常出现在中心。但是,当我缩小窗口尺寸时,框的位置会发生变化。

我正在使用 slideviewerpro 脚本,我相信它是定位框的脚本,但我无法解决该问题。这是脚本的来源:http://homegym.sg/skin/frontend/default/electronics01-black/js/jquery.slideViewerPro.1.0.js

我相信额外的图像框在div#thumbSlider中,对js文件做了一些尝试和错误的修改,但未能解决问题。

最佳答案

好的。首先,product-img-box 中带有 width:660px; 的 div 需要添加 position:relative;。然后你需要改变下面的规则

.product-view .product-img-box #ui0 {
    position: absolute;
    top: 600px;
    left: 580px;
    height: 60px;
}

.product-view .product-img-box #ui0 {
    position: absolute;
    height: 60px;
    left: 50%;
    margin-left: -200px;
    margin-top: 15px;
}

widgets.css:589

然后从那里开始调整。 :)

关于javascript - 我的元素显示在不同窗口大小的不同位置。如何定位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7474288/

相关文章:

javascript - 等于函数的变量是否被视为全局变量?

javascript - 未捕获的 FirebaseError : Messaging: This method is available in a Window context

几个数字之间的Javascript十六进制数字插值

html - CSS3 Filter 可以应用于 <select> 内的选项吗?

css - IE9 + RichFaces 渲染问题

javascript - 在php中将复选框值发送到数据库

jquery - 使用 Bootstrap 使输入/表单栏响应

asp.net - Jquery ui 工具 - 选项卡 Pane 一次全部显示

无法访问 Javascript 变量

html - 使用 CSS 覆盖透明 div 中的不透明文本