$(function(){ /*默认切换*/ $("body").sudyTab({ handle:".navcon .item", // 控制器元素,默认.tab-menu li content:".mainbox td>.maincon", // 内容体,可以有多个并以英文,号隔开,如.tab-list li,.tab-more li,默认值为".tab-list li,.tab-more li" rule:".mainbox .mod", // 排除内容体,可以有多个并以英文,号隔开,如.tab-list li,.tab-more li,默认值为".tab-list li,.tab-more li" trigger:"mouseenter", // 触发事件,默认为"mouseenter"鼠标经过 start:2, // 开始项,默认为第一 out:2, // 排除项,默认为第1 autoPlay:{ active:false, // 是否激活自动切换 interval:5000, // 自动切换时间间隔 pauseHover:true // 是否鼠标放上面时停止自动 } }); /*相关教师数据*/ //getRelateData(); if($(window).width()<768){ /*移动-导航切换*/ $("body").sudyTab({ handle:".navi-aside-wrap .navcon .item", content:".mainbox .maincon", rule:".mainbox .mod", trigger:"mouseenter", start:1, out:2, autoPlay:{ active:false, interval:5000, pauseHover:true }, callback:function(index){ //if(index!==4){ var that = this; if(!$(this).data("tabed")){ setTimeout(function(){ var id = 'wrapperinner-tab-'+index; $(that).data("tabed", true); $(that).find(".news_table").each(function(i, table){ if(!(index==4&&i!==0&&i!==3)){ var ids = id+'-'+i; $wrapper = $('
'); $scroller = $(''); $(table).wrap($wrapper); $(table).wrap($scroller); var resultContentH = $(table).height(); $("#"+ids).height(resultContentH+2); var scroller = new IScroll("#"+ids, { eventPassthrough: true, scrollX: true, scrollY: false, preventDefault: false }); setTimeout(function(){ scroller.refresh(); },0); $(table).data("scroller", scroller); } }); },10); }else{ $(that).find(".news_table").each(function(i, table){ var scroller = $(table).data("scroller"); if(scroller){ scroller.refresh(); } }); } //} } }); /*移动-默认显示第一个*/ $(".navcon .item").eq(0).trigger("mouseenter"); /*移动-输出表格信息中第一个*/ $(".new_tabs.tabs1").eq(0).sudyTab({ handle:".tab_menu .item", content:".tabs_box .tabs_con", trigger:"mouseenter", start:1, autoPlay:{ active:false, interval:5000, pauseHover:true }, callback:function(index){ if(index!==0){ var that = this; if(!$(this).data("tabed")){ setTimeout(function(){ var id1 = 'wrapperinner-tab4-'+index; $(that).data("tabed", true); $(that).find(".news_table").each(function(i, table){ var ids = id1+'-'+i; $wrapper = $(''); $scroller = $(''); $(table).wrap($wrapper); $(table).wrap($scroller); var resultContentH = $(table).height(); $("#"+ids).height(resultContentH+2); var scroller = new IScroll("#"+ids, { eventPassthrough: true, scrollX: true, scrollY: false, preventDefault: false }); setTimeout(function(){ scroller.refresh(); },0); $(table).data("scroller", scroller); }); },10); }else{ $(that).find(".news_table").each(function(i, table){ var scroller = $(table).data("scroller"); if(scroller){ scroller.refresh(); } }); } } } }); /*移动-输出表格信息中第二个*/ $(".new_tabs.tabs1").eq(1).sudyTab({ handle:".tab_menu .item", content:".tabs_box .tabs_con", trigger:"mouseenter", start:1, //默认第3个 autoPlay:{ active:false, interval:5000, pauseHover:true }, callback:function(index){ if(index!==0){ var that = this; if(!$(this).data("tabed")){ setTimeout(function(){ var id1 = 'wrapperinner-tab5-'+index; $(that).data("tabed", true); $(that).find(".news_table").each(function(i, table){ var ids = id1+'-'+i; $wrapper = $(''); $scroller = $(''); $(table).wrap($wrapper); $(table).wrap($scroller); var resultContentH = $(table).height(); $("#"+ids).height(resultContentH+2); var scroller = new IScroll("#"+ids, { eventPassthrough: true, scrollX: true, scrollY: false, preventDefault: false }); setTimeout(function(){ scroller.refresh(); },0); $(table).data("scroller", scroller); }); },10); }else{ $(that).find(".news_table").each(function(i, table){ var scroller = $(table).data("scroller"); if(scroller){ scroller.refresh(); } }); } } } }); }else{ /*默认显示*/ $(".new_tabs.tabs1,.new_tabs.tabs2").sudyTab({ handle:".tab_menu .item", content:".tabs_box .tabs_con", trigger:"mouseenter", start:1, autoPlay:{ active:false, interval:5000, pauseHover:true } }); } /*表格超过10行显示更多*/ $(".news_table").each(function(){ if($(this).find("tr").length>=11){ $(this).find("tr:gt(10)").addClass("none"); $(this).after('