var fontSize = 100; var elm = document.documentElement; if (elm.clientWidth > 640) { elm.style.fontSize = fontSize + 'px'; } if (elm.clientWidth <= 640) { elm.style.fontSize = fontSize * (elm.clientWidth / 640) + 'px'; } // wow = new WOW({ // animateClass: 'animated', // offset:100, // mobile: true, // }); // wow.init(); $(document).ready(function () { $('.nav-trigger').on('click', function (e) { e.preventDefault(); $(this).parent().toggleClass('nav-active'); }); //弹出窗口 $("#btn_center").click(function () { $("#video-center").slideToggle("slow"); $(".video-title img").click(function () { $(this).parent().parent().hide("slow"); }); }); function monthDayDiff(startTime, endTime) { let flag = [1, 3, 5, 7, 8, 10, 12, 4, 6, 9, 11, 2]; let start = new Date(startTime); let end = new Date(endTime); let year = end.getFullYear() - start.getFullYear(); let month = end.getMonth() - start.getMonth(); let day = end.getDate() - start.getDate(); if (month < 0) { year--; month = end.getMonth() + (12 - start.getMonth()); } if (day < 0) { month--; let index = flag.findIndex((temp) => { return temp === start.getMonth() + 1 }); let monthLength; if (index <= 6) { monthLength = 31; } else if (index > 6 && index <= 10) { monthLength = 30; } else { monthLength = 28; } day = end.getDate() + (monthLength - start.getDate()); } var chastr = '专业包装机械生产厂家(已成立' + year + '年' + month + '个月' + day + '天)' $('#time-diff p').text(chastr) } monthDayDiff('2011-3-17', new Date()) });