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-up-selected'); }); $('#'+_nav).stop(true,true).slideDown(200); }, 100); },function(){ var _nav = $(this).attr('_t_nav'); clearTimeout( qcloud[ _nav + '_timer' ] ); qcloud[ _nav + '_timer' ] = setTimeout(function(){ $('[_t_nav]').removeClass('nav-up-selected'); $('#'+_nav).stop(true,true).slideUp(200); }, 100); }); }); $(window).load(function(e) { var height1 = $(".abbanner").height(); $(".main_box").css("margin-top",height1) }); $(window).load(function(){ $("html,body").animate({scrollTop:0},0) var url = window.location.toString(); var id = url.split("#")[1]; if(id){ var t = $("#"+id).offset().top; $("html,body").animate({scrollTop:t},1000) } $('a').click(function(){ var a=$(this).attr("href").split("#")[1]; var p=$("#"+a).offset().top; $("html,body").animate({scrollTop:p},1000); }) }) $(function() { var h=$(window).height(); var w=$(window).width(); if(w>1440&&w<=1920){ $(window).scroll(function() { var scrollHeight = $(document).scrollTop(); if (scrollHeight > 0.52*h) { $('.mbxdh').addClass('dingwei_dh'); } else { $('.mbxdh').removeClass('dingwei_dh'); } }) }else if(w<1440){ $(window).scroll(function() { var scrollHeight = $(document).scrollTop(); if (scrollHeight > 0.48*h) { $('.mbxdh').addClass('dingwei_dh'); } else { $('.mbxdh').removeClass('dingwei_dh'); } }) } }) function show_cur_times(){ //获取当前日期 var date_time = new Date(); //定义星期 var week; //switch判断 switch (date_time.getDay()){ case 1: week="星期一"; break; case 2: week="星期二"; break; case 3: week="星期三"; break; case 4: week="星期四"; break; case 5: week="星期五"; break; case 6: week="星期六"; break; default:week="星期天"; break; } //年 var year = date_time.getFullYear(); //判断小于10,前面补0 if(year<10){ year="0"+year; } //月 var month = date_time.getMonth()+1; //判断小于10,前面补0 if(month<10){ month="0"+month; } //日 var day = date_time.getDate(); //判断小于10,前面补0 if(day<10){ day="0"+day; } //时 var hours =date_time.getHours(); //判断小于10,前面补0 if(hours<10){ hours="0"+hours; } //分 var minutes =date_time.getMinutes(); //判断小于10,前面补0 if(minutes<10){ minutes="0"+minutes; } //秒 var seconds=date_time.getSeconds(); //判断小于10,前面补0 if(seconds<10){ seconds="0"+seconds; } //拼接年月日时分秒 var date_str = year+"年"+month+"月"+day+"日 "+hours+":"+minutes+":"+seconds+" "+week; //显示在id为showtimes的容器里 document.getElementById("showtimes").innerHTML= date_str; } //设置1秒调用一次show_cur_times函数 setInterval("show_cur_times()",100);