我正在使用 jquery.cjobjectScaler 插件(链接文本),由于我无法控制的情况,img 在 div 中超链接...我没有任何方法可以“剥离”该标签,也无法重新排序它根本...
所以,原来的功能是这样的:
$("#productGrid li img").cjObjectScaler({
destObj: $("#productGrid li img").parent("li"), // must be a jQuery object (required)
method: "fit", // can either be fit or fill (default fill)
fade: 800 // if a positive integer, will hide and fadeIn object n duration (default 0)
});
/* CSS for above */
ul#productGrid li {
position: relative;
display: block;
width: 190px;
height: 150px;
border: 1px solid #ccc;
float: left;
margin-right:
10px; margin-bottom:
10px; overflow: hidden;
}
这是我正在尝试使用的版本...
$(".ffts a img").cjObjectScaler({
destObj: $(".ffts a img").parent("a"),
method: "fill",
});
/* css for above */
.ffts a {
width: 550px;
height: 300px;
}
/* here's the markup */
<div class="ffts">
<a href="/img" style="position: relative;">
<img src="/source/image.jpg" />
</a>
</div>
而且,它确实调整了它的大小,但没有调整到为 ffts a 设置的尺寸......我已经验证了该样式没有被覆盖,所以不知道从哪里开始......?