" + obj[i].Content + "查看 >"; } switch (type) { case 0: $("#all").html(strHtml); var cur = "all"; break; case 5: $("#company").html(strHtml); var cur = "company"; break; case 6: $("#alpha").html(strHtml); var cur = "alpha"; break; case 7: $("#scrm").html(strHtml); var cur = "scrm"; break; } //- 計算當前容器高度 $('.case_list').height($('#' + cur).find('li').size() * 185); $("#dPagaBer").html(data.PagaBar); } }) } switch (oType) { case 0: fnFlipVver(1, 0); $("li[data-flag='all']").siblings().removeClass('active'); $("li[data-flag='all']").addClass('active'); break; case 5: $("li[data-flag='company']").siblings().removeClass('active'); $("li[data-flag='company']").addClass('active'); fnFlipVver(1, 5); break; case 6: $("li[data-flag='alpha']").siblings().removeClass('active'); $("li[data-flag='alpha']").addClass('active'); fnFlipVver(1, 6); break; case 7: $("li[data-flag='scrm']").siblings().removeClass('active'); $("li[data-flag='scrm']").addClass('active'); fnFlipVver(1, 7); break; } $(function () { $('.case_tab li').click(function () { $(this).siblings().removeClass('active'); $(this).addClass('active'); var cur = $(this).attr('data-flag'); //- 計算當前容器高度 $('.case_list').height($('#' + cur).find('li').size() * 185); $('#' + cur).siblings().css({ 'opacity': '0', 'transition': 'opacity 0.2s ease-out', 'zIndex': 0 }); $('#' + cur).css({ 'opacity': '1', 'transition': 'opacity 0.4s ease-in-out', 'zIndex': 5 }); }); var showCurrentTab = function (key) { var $eleTab = $('.case_tab ul'), $eleContent = $('.case_list'); $.map($eleTab.find('li'), function (item, index) { if ($(item).attr('data-flag') == key) { //重置tab $eleTab.children().removeClass('active'); $eleTab.children().eq(index).addClass('active'); //- 重置content $eleContent.children().css('opacity', '0'); $eleContent.height($('#' + key).find('li').size() * 185); $('#' + key).css({ 'opacity': '1', 'zIndex': 5, 'position': 'relative' }); } }) }; var init = function () { $('.case_list').height(10000); showCurrentTab(window.location.href.split('#')[1]); }; init(); }) 网上看新闻赚钱是不是真的