$(document).ready(function() { $(".img2-item").eq(0).removeClass("fr").addClass("fl"); $('.ph_p5Con_box2 .fl ul').eq(0).show(); $('.ph_p5Con_box2 .fr ul').eq(0).show(); $(".ph_p5Con_box .qhly").eq(0).show(); /*nav*/ var $ph00=$(".ph_nav_ul li.navmon"); var $ph01=$(".ph_nav_box"); $ph00.mouseover(function(){ var index=$ph00.index(this); $ph01.eq(index).show(); $(".ph_nav").css("height","154px"); }); $ph00.mouseout(function(){ $ph01.hide(); $(".ph_nav").css("height","77px"); }) var spanqh1=$('.ph_p5Con_box2 .fl .ph_tit4 span'); spanqh1.each(function(index, element) { $(this).hover(function(){ var index1=spanqh1.index(this); spanqh1.removeClass("active").eq(index1).addClass("active"); $('.ph_p5Con_box2 .fl ul').hide().eq(index1).show(); }) }); var spanqh2=$('.ph_p5Con_box2 .fr .ph_tit4 span'); spanqh2.each(function(index, element) { $(this).hover(function(){ var index2=spanqh2.index(this); spanqh2.removeClass("active").eq(index2).addClass("active"); $('.ph_p5Con_box2 .fr ul').hide().eq(index2).show(); }) }); function updateNavPosition() { $('.preview .active-nav').removeClass('active-nav') var activeNav = $('.preview .swiper-slide').eq(viewSwiper.activeIndex).addClass('active-nav') if (!activeNav.hasClass('swiper-slide-visible')) { if (activeNav.index() > previewSwiper.activeIndex) { var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1 previewSwiper.swipeTo(activeNav.index() - thumbsPerNav) } else { previewSwiper.swipeTo(activeNav.index()) } } } /*weixin*/ $('.close1').on('click', function(){ $('.wx_box1').hide(); }); $('.close2').on('click', function(){ $('.wx_box2').hide(); }); $(document).scroll(function(){ var bkTop=$(this).scrollTop(); if(bkTop > 200){ $(".topb").show() } else{ $(".topb").hide() } }) $(".topb").click(function(){ $('html , body').animate({scrollTop: 0},500); }); var pageCount;//?卞?椤? var pageNum = 8;//??〉?℃? var currentpage=1; var lengthH; var cshu=$(".dsbk .item"); pageCount=Math.ceil(cshu.length/pageNum); $(".huan").on('click', function(e) { e.preventDefault() fanKui(); }) fanKui() function fanKui() { //console.log(currentpage) cshu.hide(); var num =(currentpage-1)*pageNum; var num1=currentpage*pageNum; for(var i=num;i 0){ $("#nr01").html(cshu.eq(index1-1).html()) index1=index1-1; if(index1==0){ $(".tp01 .fanye span.pv").hide() } if(index1 < sc01lh){ $(".tp01 .fanye span.nt").show() } } }) $(".tp01 .fanye span.nt").click(function(){ if(index1 >= 0){ $("#nr01").html(cshu.eq(index1+1).html()) index1=index1+1; $(".tp01 .fanye span.pv").show() if(index1 == sc01lh){ $(".tp01 .fanye span.nt").hide() } } }) $(".close").click(function(){ $(".tp01").fadeOut() }); }); // ?ュ? var month_olypic = [31,29,31,30,31,30,31,31,30,31,30,31];//?板勾姣?釜??唤??ぉ?? var month_normal = [31,28,31,30,31,30,31,31,30,31,30,31]; var month_name =["1","2","3","4","5","6","7","8","9","10","11","12"]; //?峰?浠ヤ???釜?ㄥ???d var holder = document.getElementById("days"); var prev = document.getElementById("prev"); var next = document.getElementById("next"); var ctitle = document.getElementById("calendar-title"); var cyear = document.getElementById("calendar-year"); //?峰?褰?ぉ??勾??? var my_date = new Date(); var my_year = my_date.getFullYear();//?峰?骞翠唤 var my_month = my_date.getMonth(); //?峰???唤锛????唤?????负0 var my_day = my_date.getDate();//?峰?褰???ユ? //?规?骞存??峰?褰??绗?澶╂??ㄥ? function dayStart(month,year){ var tmpDate = new Date(year, month, 1); return (tmpDate.getDay()); } //?规?骞翠唤?ゆ???????灏?ぉ(11,2018),琛ㄧず2018骞?12?? function daysMonth(month, year){ var tmp1 = year % 4; var tmp2 = year % 100; var tmp3 = year % 400; if((tmp1 == 0 && tmp2 != 0) || (tmp3 == 0)){ return (month_olypic[month]);//?板勾 }else{ return (month_normal[month]);//???骞? } } var showYear = 0 var showMonth = 0 function refreshDate(){ var str = ""; var totalDay = daysMonth(my_month,my_year); var firstDay = dayStart(my_month, my_year); for(var i = 0; i < firstDay; i++){ str += "
  • "+"
  • "; } var myclass; for(var i = 1; i <= totalDay; i++){ var dateStr = my_year + '-' + (my_month + 1) + '-' + i if((my_year < my_date.getFullYear())||(my_year == my_date.getFullYear() && my_month < my_date.getMonth()) || (my_year == my_date.getFullYear() && my_month == my_date.getMonth() && i < my_day)){ myclass = " class='lightgrey' onclick='checkIt(" + i + ", event)'"; } else if(my_year == my_date.getFullYear() && my_month == my_date.getMonth() && i == my_day){ // console.log(my_day, i) myclass = "class = 'lightgrey active start-day' onclick='checkIt(" + i + ", event)'"; }else{ myclass = "class = 'darkgrey'"; } str += "
  • "+i+"
  • "; } holder.innerHTML = str; ctitle.innerHTML = month_name[my_month] + '月' showYear = parseInt(my_year) showMonth = parseInt(month_name[my_month]) cyear.innerHTML = my_year; setTimeout(function () { checkIt(my_day) // creatDate(dateStr) }, 0); } refreshDate(); pre.onclick = function(e){ e.preventDefault(); my_month--; if(my_month < 0){ my_year--; my_month = 11; } refreshDate(); } next.onclick = function(e){ e.preventDefault(); my_month++; if(my_month > 11){ my_month = 0; my_year++; } refreshDate(); } var activeIndexDate = 0; var tempDate = null; function creatDate(data) { tempDate = data //console.log(data) if (data && data[activeIndexDate]) { // console.log(data[activeIndexDate]) document.querySelector('.right-panel .conn').innerHTML = data[activeIndexDate] } else { document.querySelector('.right-panel .conn').innerHTML = '你好你好你好' document.querySelector('.syy').style.display = 'none' document.querySelector('.xyy').style.display = 'none' return } if (!data[activeIndexDate - 1]) { document.querySelector('.syy').style.display = 'none' } else { document.querySelector('.syy').style.display = 'block' } if (!data[activeIndexDate + 1]) { document.querySelector('.xyy').style.display = 'none' } else { document.querySelector('.xyy').style.display = 'block' } } function syy () { activeIndexDate-- creatDate(tempDate) } function xyy() { activeIndexDate++ creatDate(tempDate) } function checkIt(day, event) { activeIndexDate = 0 var ltsh=$('.lightgrey'); for(var i=0;i