//时间 function getNow(Mytime) { return Mytime < 10 ? '0' + Mytime : Mytime; } function CurrentTime() { var myDate = new Date(); //获取当前年份 var year = myDate.getFullYear(); //获取当前月份 var month = myDate.getMonth() + 1; //获取当前日期 var date = myDate.getDate(); //获取当前小时数(0-23) var h = myDate.getHours(); //获取当前分钟数(0-59) var m = myDate.getMinutes(); var s = myDate.getSeconds(); var now = year + '年' + getNow(month)+ '月' + getNow(date)+ '日'; var now2 = getNow(h)+ ':' + getNow(m) + ':' + getNow(s); $(".nyr").text(now); $(".sfm").text(now2); } $(function(){ //间隔一秒执行一次获取当前时间的方法 setInterval(function () { CurrentTime() }, 1000); // 二维三维切换 $(".wei a").on("click", function() { var position = $(this) .parent() .position(); var width = $(this) .parent() .width(); $(".wei .slide1").css({ opacity: 1, left: +position.left, width: width }); $(this).addClass('active').parents('li').siblings('li').find('a').removeClass('active'); }); $(".wei a").on("mouseover", function() { var position = $(this) .parent() .position(); var width = $(this) .parent() .width(); $(".wei .slide2") .css({ opacity: 1, left: +position.left, width: width }) .addClass("squeeze"); }); $(".wei a").on("mouseout", function() { $(".wei .slide2") .css({ opacity: 0 }) .removeClass("squeeze"); }); var currentWidth = $(".wei .wei_tab") .find(".active") .parent("li") .width(); var current = $(".wei_tab .active").position(); $(".wei .slide1").css({ left: +current.left, width: currentWidth }); // 二维三维 图片切换 $(".wei_tab .aa").on('click',function(){ if($(this).hasClass('ew_li')){ $('.map_tab').show(); }else{ $('.map_tab').hide(); } }); //右侧导航显示隐藏 var a = 0 $(".zhly_close").on('click',function(){ var wid = $(".zhly_k").width()+39; a = a + 1; if (a % 2 != 0) { $(".zhly_k").animate({ right: '-'+ wid +'px' },500) }else { $('.zhly_k').stop(true, true).animate({ right:'0px' }, 500); } }); //nav导航点击切换 $(".nav_div .nav").on('click', function () { $(this).children('div').addClass('on'); $(this).siblings('.nav').children('div').removeClass('on'); // if($(this).children('div').attr("url") == "getVisualizationFrame_WRJ"){ if($(this)[0].className == "nav wrj" || $(this)[0].className == "nav cl" || $(this)[0].className == "nav clmj" ){ $(".zhly_k").hide(); }else{ $(".zhly_k").show(); } $("#qt_iframe").attr("src", "/visualization/event/" + $(this).children('div').attr("url")); //首页得导航 if($(".sj").children('div').hasClass('on')){ $(".left_nav").show(); }else{ $(".left_nav").hide(); } if($(".sl").children('div').hasClass('on')){ $("#sl_nav").show(); }else{ $("#sl_nav").hide(); } }); // $(".sj").on('click',function(){ // $(".left_nav").toggle(); // }); // // iframe高度 // var hei = $(document).height(); // var wid = $(document).width(); $("#qt_iframe").height(800); // $("#qt_iframe").width(wid); });