$(function(){ var Wwidth = $(window).width(); var os = function() { var ua = navigator.userAgent, isWindowsPhone = /(?:Windows Phone)/.test(ua), isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone, isAndroid = /(?:Android)/.test(ua), isFireFox = /(?:Firefox)/.test(ua), isChrome = /(?:Chrome|CriOS)/.test(ua), isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)), isPhone = /(?:iPhone)/.test(ua) && !isTablet, isPc = !isPhone && !isAndroid && !isSymbian; return { isTablet: isTablet, isPhone: isPhone, isAndroid : isAndroid, isPc : isPc }; }(); if(os.isPc && Wwidth > 1000){ $(window).scroll(function(event){ var top = $(this).scrollTop()||0; if( top >30){ $("#header").css({ "position":"fixed", "top":10, "z-index":1005 }).addClass("mini"); }else{ $("#header").css({ "position":"fixed", "top": 45 }).removeClass("mini"); } }); } $(".mbanner .focus").sudyfocus({ p:2, zWidth:1920, zHeight:678, title:{ isAutoWidth: true, active:true }, text:{ active: false, isAutoHeight: false, href: false }, response: true, speed:700, pagination: true, navigation: true, isNavHover: false, href:true, effect: 'fade' }); var $post11 = $('.post-11 .news_list'); $post11.slick({ dots: true, infinite: true, autoplay:true, slide: 'li', //swipe:false, //touchMove:false, touchThreshold:100, //draggable:false, lazyLoad:'ondemand', slidesToShow:1, slidesToScroll:1 }); /*$(window).resize(function(){ var Wwidth = $(window).width(); if(Wwidth < 1000){ if($post11.hasClass("slick-slider")){ console.log(111); var $post11 = $('.post-11 .news_list'); $post11.unslick(); } }else{ $post11.slick({ dots: true, infinite: true, autoplay:true, slide: 'li', touchThreshold:100, lazyLoad:'ondemand', slidesToShow:1, slidesToScroll:1 }); } });*/ $('.post-31 .news_list').slick({ dots: false, infinite: true, autoplay:true, autoplaySpeed:10000, slide: 'li', slidesToShow:3, slidesToScroll:3, responsive: [ { breakpoint: 1200, settings: { slide: 'li', slidesToShow: 3, slidesToScroll: 3, infinite: true } }, { breakpoint: 1000, settings: { slide: 'li', slidesToShow: 3, slidesToScroll: 3 } }, { breakpoint: 600, settings: { slide: 'li', slidesToShow:2, slidesToScroll: 2 } } ] }); $(".post-21").find(".news").each(function(){ var marth = $(this).find(".news_year").text(); $(this).find(".news_year").text(getMonthEN(marth).slice(0,3)); }); $(".main5").find(".news").each(function(){ $(this).hover(function(){ $(this).addClass("hover"); },function(){ $(this).removeClass("hover"); }); }); function getMonthEN(n){ var num = parseInt(n, 10), month = ""; if (num == 1) { month = "January" } if (num == 2) { month = "February" } if (num == 3) { month = "March" } if (num == 4) { month = "April" } if (num == 5) { month = "May" } if (num == 6) { month = "June" } if (num == 7) { month = "July" } if (num == 8) { month = "August" } if (num == 9) { month = "September" } if (num == 10) { month = "October" } if (num == 11) { month = "November" } if (num == 12) { month = "December" } return month; } });