$(function(){ var url = location.href; $('.tab2 a').each(function(index){ var href = $(this).attr('href'); if(url&&url.indexof(href)>-1){ $('.tab2 .item').removeclass('active'); $('.tab2 .item').eq(index).addclass('active'); } }) //fixed var width = $(window).width(); if(width<768){ autofixed(); } $("#test1").height(width/3.69); $(document).on("onresize",function(event,resizedwinwidth, resizedwinheight, scale){ if(resizedwinwidth<768){ autofixed(); }else{ $('.fixed2').css({'padding-top':0+'px'}); } $("#test1").height(resizedwinwidth/3.69); }); function autofixed(){ var hei = $('.fixed').height(); $('.fixed2').css({'padding-top':hei+'px'}); } //tabs $('.tab2 .item').click(function(){ $('.tab2 .item').removeclass('active'); $(this).addclass('active'); var index = $(this).index(); $('.fixed2').removeclass('active'); $('.fixed2').eq(index).addclass('active'); }) }) function downloadfile(path){ if(path && path!='#'){ document.location.href = "/base/download/file?path=" + encodeuri(path); } }