var pageurl = window.location.search; if(pageurl == '?m2w') { addcookie('m2wcookie', '1', 0); } if(getcookie('m2wcookie') != '1' && browserredirect()) { location.href = 'http://m.xinje.com'; } /*工具类方法 ------------------------------------------------*/ //检测是否移动设备来访 function browserredirect() { var suseragent= navigator.useragent.tolowercase(); var bisipad= suseragent.match(/ipad/i) == "ipad"; var bisiphoneos= suseragent.match(/iphone os/i) == "iphone os"; var bismidp= suseragent.match(/midp/i) == "midp"; var bisuc7= suseragent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bisuc= suseragent.match(/ucweb/i) == "ucweb"; var bisandroid= suseragent.match(/android/i) == "android"; var bisce= suseragent.match(/windows ce/i) == "windows ce"; var biswm= suseragent.match(/windows mobile/i) == "windows mobile"; if (bisipad || bisiphoneos || bismidp || bisuc7 || bisuc || bisandroid || bisce || biswm) { return true; } else { return false; } } //写cookie function addcookie(objname, objvalue, objhours) { var str = objname + "=" + escape(objvalue); if (objhours > 0) {//为0时不设定过期时间,浏览器关闭时cookie自动消失 var date = new date(); var ms = objhours * 3600 * 1000; date.settime(date.gettime() + ms); str += "; expires=" + date.togmtstring(); } document.cookie = str; } //读cookie function getcookie(objname) {//获取指定名称的cookie的值 var arrstr = document.cookie.split("; "); for (var i = 0; i < arrstr.length; i++) { var temp = arrstr[i].split("="); if (temp[0] == objname) return unescape(temp[1]); } return ""; } $(function () { if ($("#sidebar > dl:nth-child(4) > dt > a > span").text() == "员工招聘") { $("#sidebar > dl:nth-child(4) > dt > a").attr("href", "https://www.hotjob.cn/wt/xinje/web/index?brandcode=1"); } var myswiper1 = new swiper ('.swiper-container1', { direction: 'horizontal', autoplay : 3000, speed:1500, loop: true, prevbutton:'.swiper-button-prev', nextbutton:'.swiper-button-next', effect : 'fade' }); var myswiper2 = new swiper ('.swiper-container2', { direction: 'horizontal', autoplay : 3000, loop: true, speed:1000, slidesperview : 3, prevbutton:'.swiper-button-prev', nextbutton:'.swiper-button-next' }); $(".go-top").click(function(){ $("html,body").animate({scrolltop:"0px"},500); }); $(".yy").hover(function(){ $(".yy .yuyanin").slidedown(); },function(){ $(".yy .yuyanin").stop().slideup(); }); $(".incasetit span").eq(0).addclass("active"); $(".incaselist .incseli").eq(0).show(); $(".incasetit span").hover(function(){ $(this).addclass("active").siblings().removeclass("active"); $(".incaselist .incseli").eq($(this).index()).show().siblings().stop().hide(); }) // 企业宣传片 $('#video_play').click(function(){ $(this).hide(); var video = $('#about_video')[0]; video.style.csstext='-webkit-transform: scaley(1);transform: scaley(1);'; video.play(); }) // animate $('.service-icon').hover(function(){ $(this).find('img').addclass('animated bounce'); },function(){ $(this).find('img').removeclass('animated bounce'); }); $('.learn-more').hover(function(){ $(this).addclass('animated rubberband'); },function(){ $(this).removeclass('animated rubberband'); }); $('#sidebar dl dt').click(function(){ $(this).toggleclass('on'); $(this).next('dd').toggle(); }) }) (function($){ $.fn.myscroll = function(options){ //默认配置 var defaults = { speed:40, //滚动速度,值越大速度越慢 rowwidth:24 }; var opts = $.extend({}, defaults, options),intid = []; function marquee(obj, step){ obj.find("ul").animate({ marginleft: '-=1' },0,function(){ var s = math.abs(parseint($(this).css("margin-left"))); if(s >= step){ $(this).find("li").slice(0, 1).appendto($(this)); $(this).css("margin-left", 0); } }); } this.each(function(i){ var sh = opts["rowwidth"],speed = opts["speed"],_this = $(this); intid[i] = setinterval(function(){ if(_this.find("ul").width()<=_this.width()){ clearinterval(intid[i]); }else{ marquee(_this, sh); } }, speed); _this.hover(function(){ clearinterval(intid[i]); },function(){ intid[i] = setinterval(function(){ if(_this.find("ul").width()<=_this.width()){ clearinterval(intid[i]); }else{ marquee(_this, sh); } }, speed); }); }); } })(jquery);