2009-12-11 108 views
0

我使用jquery.cjobjectScaler插件(link text),並且由於我無法控制的情況,img在div中超鏈接...我沒有任何方法「去掉」該標籤,也不能重新排序在所有...jquery - 獲取父級的父級?

因此,原有的功能是這樣的:

$("#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> 

而且,它調整大小,但不是爲fft設置的尺寸...我已經驗證呃,這種風格沒有被覆蓋,所以不知道從哪裏去......?

+0

這是什麼調整到呢? 'ffts'? – 2009-12-11 06:15:25

回答

2

你的問題不太清楚,但如果你只是想「得到父母的父母」,使用prev()parents()選擇器。

+0

meh ...我在發帖後約2秒找到了它:) – n00b0101 2009-12-11 06:12:28