我在一個特殊的「問題」在這裏。 Ti適應來自客戶端的請求,我需要執行以下操作。瀏覽頁面上的所有表格。對於每張表格,檢查它是否恰好有2個TD。如果確實如此,那麼我需要做一個「更多閱讀」的實現。jquery通過表運行,只能做2x TDs
我已經在另一個頁面上使用過,我知道我想摺疊和展開的確切div。
$(".more-block").each(function(){
if ($(this).height() > adjustheight){
id = this.id;
id = id.split("_");
$("#expand"+id[1]).toggle(function() {
id = this.id;
$(".more-block"+id).css('height', 'auto').css('overflow', 'visible');
$('html, body').animate({scrollTop: $(document).height()}, 'slow');
$("#"+id).attr('src',path+'/images/expand2.png');
$(".frontpage_box").css('height', '');
}, function() {
id = this.id;
$("#"+id).attr('src',path+'/images/expand.png');
$(".more-block"+id).animate({height: adjustheight}, "slow", function(){
$(".more-block"+id).css('height', adjustheight).css('overflow', 'hidden');
});
});
};
});
$(".more-block").css('height', adjustheight).css('overflow', 'hidden');
任何想法? 當我運行TD時,我只需添加「more-less」和「more-lessexpand1」(數字爲增量)。這可能嗎?我不知道如何運行這些表格,只有在找到兩個TD並且只在第二個TD上進行最後一點時才這樣做。
哦,順便說一句......其重要的是它只有第二個TD崩潰和擴大。左邊的是不允許的。如果有人能幫我找到運輸署的興趣,我或許能解決這個問題。
請幫
你堅持什麼地方?查找具有兩個'td'元素的'table'元素?閱讀更多的執行..? – 2012-07-23 21:54:06
首先,建立一個[fiddle](http://jsfiddle.net),其次,你確定你應該爲客戶做這種工作嗎? – adeneo 2012-07-23 21:54:21
我被困在尋找TD的問題。 @nnnnnn似乎已經發布了一個解決方案,我會嘗試。和adeneo - auch ...你永遠的歡迎,以另一種解決方案,將有助於更多的幫助...沒有需要的其他部分... – 2012-07-23 22:01:14