// 轮播图 jQuery(".slideBox").slide({ mainCell: ".bd ul", autoPlay: true, effect: "leftLoop" }); //搜索框 $(function() { var tiemer = ""; var time = 500; //每次点击三秒后才能bai再次点击 var fun = function searClick() { var o = $(".searchbox"); if (!o.hasClass('on')) { o.addClass('on') $(".searchbox").animate({ width: 255 }, 500, 'linear') } else { o.removeClass('on'); $(".searchbox").animate({ width: 0 }, 500, 'linear') } $(".button").unbind("click"); tiemer = setTimeout(function() { $(".button").click(fun); }, time); }; $(".button").click(fun); }) //底部下拉 $(function() { var vNavWaitSlide, NavWaitSlide; $('.CnEn ul>li').hover( function() { $(this).find('a:first').addClass("hover "); var current_li = $(this), targ = $(current_li).find('ul:first'); NavWaitSlide = setTimeout(function() { if (!$(targ).is(':visible')) { $(targ).slideDown(200); } }, 100) }, function() { clearTimeout(NavWaitSlide); $(this).find('ul').hide(); $(this).find('a:first').removeClass("hover"); } ); }) //Alumni下拉 $("#faculty").hover( function(){ $(this).addClass('hover') }, function(){ $(this).removeClass('hover') } ) $(function() { var vNavWaitSlide, NavWaitSlide; $('.con ul.list>li').hover( function() { $(this).find('a:first').addClass("hover "); var current_li = $(this), targ = $(current_li).find('ul:first'); NavWaitSlide = setTimeout(function() { if (!$(targ).is(':visible')) { $(targ).slideDown(200); } }, 100) }, function() { clearTimeout(NavWaitSlide); $(this).find('ul').hide(); $(this).find('a:first').removeClass("hover"); } ); }) //news&events的tarbar切换 jQuery(".inBox").slide({ titCell: ".inHd li", mainCell: ".inBd" }); //自适应 function fontSize() { var deviceWidth = document.documentElement.clientWidth; document.documentElement.style.fontSize = (deviceWidth / 100) + "px"; console.log(deviceWidth); console.log(document.documentElement.style.fontSize); } fontSize(); window.onresize = fontSize;