0
我的js的以下部分显示并隐藏名为gallery_item_details_list的ul类,该类很好地工作。显示隐藏多个块
var detailsBlock = $(location.hash);
$(".gallery_item_details_list .gallery_item_details").css("display", "none");
detailsBlock.css("display", "block");
var galleryItem = $("#gallery-item-" + location.hash.substr(17));
detailsBlock.find(".prev").attr("href", (galleryItem.prevAll(":not('.isotope-hidden')").first().length ? galleryItem.prevAll(":not('.isotope-hidden')").first().find(".open_details").attr("href") : $(".gallery:not('.horizontal_carousel')").children(":not('.isotope-hidden')").last().find(".open_details").attr("href")));
detailsBlock.find(".next").attr("href", (galleryItem.nextAll(":not('.isotope-hidden')").first().length ? galleryItem.nextAll(":not('.isotope-hidden')").first().find(".open_details").attr("href") : $(".gallery:not('.horizontal_carousel')").children(":not('.isotope-hidden')").first().find(".open_details").attr("href")));
var visible=parseInt($(".gallery_item_details_list").css("height"))==0 ? false : true;
var galleryItemDetailsOffset;
if(!visible)
{
$(".gallery_item_details_list").css("display", "block").animate({height:detailsBlock.height()}, 500, 'easeOutQuint', function(){
$(this).css("height", "100%");
$(location.hash + " .image_carousel").trigger("updateSizesCustom");
});
我的问题是,现在,这可怎么代码进行修改,以显示/隐藏另一个名为例如contact_block额外的课?我试图代码更改为:
$(".gallery_item_details_list .gallery_item_details .contact_block").css("display", "none");
和
$(".gallery_item_details_list .contact_block").css("display", "block").animate({height:detailsBlock.height()}, 500, 'easeOutQuint', function(){
然而,这似乎并没有工作。
一些专家的帮助将得到真正的赞赏。
非常感谢你@nnnnnn - 你的解决方案工作得很好! – DaveMilan 2013-04-11 14:40:29