var istouch = modernizr.touch, ismobile = false,//区分移动端与pc端 mobile = false,//区分手机端与平板 w_width = 0, w_height = 0, bannerimgh=638, navitem = 0, h_height=0, roll=0, stop=150, produs=0, st = 0; var _mousemove; var _click; var _mousedown; var _mouseup; //移动端事件和pc事件的切换 if (modernizr.touch) { _mousemove = "touchmove"; _click = "touchend"; _mousedown = "touchstart"; _mouseup = "touchend"; } else { _mousemove = "mousemove"; _click = "click"; _mousedown = "mousedown"; _mouseup = "mouseup"; }; function pagebox() { w_width = jquery(window).width(); w_height = jquery(window).height(); //设置移动端参数 if (w_width <= 1024) { ismobile = true; } else if (w_width > 1024) { ismobile = false; }; //区分手机端和平板 if (w_width <= 640) { mobile = true; } else if (w_width > 640) { mobile = false; }; $('.gudesbg').css('height',w_height); setimgmax($('.gudesbg img'), 1920, 960, w_width, w_height); if(ismobile){ $("body").find('.article-block').removeclass('article-block'); } } pagebox(); jquery(window).resize(function () { pagebox(); }); //导航hover var navhover = { init: function() { this.sethover(); }, sethover: function() { var index1=$(".nav__list >li.active").index(); $(".nav__list >li").hover(function(){ $(this).addclass('active').siblings().removeclass('active'); },function(){ $(".nav__list >li").removeclass('active').eq(index1).addclass('active'); }); $('.menubtn').on('click', function(e) { e.stoppropagation(); $(this).stop().toggleclass('active'); $(".menus").hide(); $(".navigate").fadetoggle(); }); $(".navigatefix >li >a").bind("click", function (e) { var $navmobile=jquery(".navigate"), $nava=$navmobile.find(".navigatefix >li >a"), $msubnav=$navmobile.find(".navigate__down"); var hjcur = $(this); var hjdd = $(this).parents("li"); if (hjdd.find(".navigate__down").size() > 0) { if (hjdd.hasclass("on")) { $navmobile.fadeout(); hjdd.find(".navigate__down").stop(false, false).slideup(); hjdd.removeclass("on"); } else { $nava.parents('li').removeclass("on"); $msubnav.stop(false, false).slideup(); hjdd.find(".navigate__down").stop(false, false).slidedown(); hjdd.addclass("on"); e.preventdefault(); } } }); $(document).ready(function(){ var indexs=$(".levallist li.active").index(); var now=$(".levallist li").width()*indexs; $(".leval__menu").animate({scrollleft:now}); var indexs1=$(".recuites li.active").index(); var now1=$(".recuites li").width()*indexs1; $(".recuite__list").animate({scrollleft:now1}); }); } }; //友情链接 var relative = { init: function() { this.reclick(); }, reclick: function() { $(".relative span").click(function(){ $(this).toggleclass('active'); $(".retivedown").stop().slidetoggle(); }); $(".relative").mouseleave(function(){ $(".relative span").removeclass('active'); $(".retivedown").stop().slideup(); }); } }; //内页banner var scollinner = { init: function() { this.setscoll(); }, setscoll: function() { jquery(window).scroll(function () { var header= $(".header__top ").outerheight(); var windowtop = jquery(window).scrolltop(); if (!ismobile) { jquery('').css('transform', "translate(0px," + (windowtop) / 3 + "px)"); }; }); } }; //滚动header var headerscoll = { init: function() { this.setnav(); }, setscoll: function() { function b(){ var s = $(window).scrolltop(); var header= $(".header__top ").outerheight(); s > header ? $(".header__nav").addclass("flex"): $(".header__nav").removeclass("flex"); } $(window).scroll(b), b(); } }; navhover.sethover(); scollinner.setscoll(); relative.reclick(); headerscoll.setscoll(); jquery(window).load(function(){ jquery('.article-block').delay(300).scrollclass(); }); (function(jquery){ $.fn.scrollclass = function(config){ var defaults = {}; var config = jquery.extend(defaults, config); var target = this; function addaction(){ var length = target.length; for(var i=0; i关闭
'; $("body").append(str); jquery(".popupblack").fadein(); jquery(".popup").animate({margintop:"-127"},400); $(".popup .close").click(function () { $(".popupblack").remove(); }); jquery(".popupblack").click(function(){$(".popupblack").remove();}); return false; }); }; function setimgmax(img, imgw, imgh, tw, th) { var twidth = tw || w_width; var theight = th || w_height; var coe = imgh / imgw; var coe2 = theight / twidth; if (coe < coe2) { var imgwidth = theight / coe; img.css({ height: theight, width: imgwidth, left: -(imgwidth - twidth) / 2, top: 0 }); } else { var imgheight = twidth * coe; img.css({ height: imgheight, width: twidth, left: 0, top: -(imgheight - theight) / 2 }); }; }; var video = { load: function(objs) { var objplay = jwplayer(objs.vcontainer).setup({ flashplayer: 'js/video/flashplay.swf', html5player: 'js/video/html5player.js', file: objs.vfiles, image: objs.vfimg, width: '100%', height: '100%', aspectratio: '16:9', stretching: 'fill', controls: 'true', autostart: objs.isautoplay }); return objplay; } } jquery(".vwrap .closes,.vwrap .videobtg").click(function() { jquery(".vwrap").hide(); $('#videobox').html(""); });