//公共js //nav导航下拉菜单 jQuery(document).ready(function(){ var qcloud={}; $('[_t_nav]').hover(function(){ var _nav = $(this).attr('_t_nav'); clearTimeout( qcloud[ _nav + '_timer' ] ); qcloud[ _nav + '_timer' ] = setTimeout(function(){ $('[_t_nav]').each(function(){ $(this)[ _nav == $(this).attr('_t_nav') ? 'addClass':'removeClass' ]('nav_selected'); }); $('#'+_nav).stop(true,true).slideDown(200); }, 150); },function(){ var _nav = $(this).attr('_t_nav'); clearTimeout( qcloud[ _nav + '_timer' ] ); qcloud[ _nav + '_timer' ] = setTimeout(function(){ $('[_t_nav]').removeClass('nav_selected'); $('#'+_nav).stop(true,true).slideUp(200); }, 150); }); }); //首页banner切换 $(document).ready(function(){ Qfast.add('widgets', { path: "/static/default/js/terminator2.2.min.js", type: "js", requires: ['fx'] }); Qfast(false, 'widgets', function () { K.tabs({ id: 'fsD1', //焦点图包裹id conId: "D1pic1", //** 大图域包裹id tabId:"D1fBt", tabTn:"a", conCn: '.fcon', //**大图域配置class auto: 1, //自动播放 1或0 effect: 'fade', //效果配置 eType: 'click', //**鼠标事件 pageBt:true, //是否有按钮切换页码 bns: ['.prev', '.next'], //**前后按钮配置class interval: 3000 //** 停顿时间 }); }); }); //News内容切换过渡效果 $(function(){ $('#owl-demo').owlCarousel({ items:1, autoPlay:true, autoHeight:true, transitionStyle:'fade' //CSS3过度效果 }); }); $(document).ready(function(){ //Events首页右侧内容偶数奇数行添加样式 $(".news_notice dl:even").addClass("event1");//奇数行 $(".news_notice dl:odd").addClass("event2");//偶数行 /*学术活动列表*/ $(".academic_list dl:even").css("float","left");//偶数行 $(".academic_list dl:odd").css("float","right");//奇数行 }); //二级页 //programs二级页左侧三级导航 $(document).ready(function() { $('.inactive').click(function(e){ e.preventDefault(); if($(this).siblings('ul').css('display')=='none'){ $(this).parent('li').siblings('li').removeClass('inactives'); $(this).addClass('inactives'); $(this).siblings('ul').slideDown(100).children('li'); if($(this).parents('li').siblings('li').children('ul').css('display')=='block'){ $(this).parents('li').siblings('li').children('ul').parent('li').children('a').removeClass('inactives'); $(this).parents('li').siblings('li').children('ul').slideUp(100); } }else{ $(this).removeClass('inactives'); $(this).siblings('ul').slideUp(100); $(this).siblings('ul').children('li').children('ul').parent('li').children('a').addClass('inactives'); $(this).siblings('ul').children('li').children('ul').slideUp(100); $(this).siblings('ul').children('li').children('a').removeClass('inactives'); } }) }); //合作办学--机械博物馆--图片轮播 $(function(){ var mySwiper = new Swiper('#swiper1',{ autoplay :3000, pagination:'#swiper-p1', paginationClickable:true, moveStartThreshold:100, loop:true, loopAdditionalSlides:1, }); var mySwiper = new Swiper('#swiper2',{ autoplay :3000, pagination:'#swiper-p2', paginationClickable:true, moveStartThreshold:100, loop:true, loopAdditionalSlides:1, }) });