/** * Created by Administrator on 2018/3/13 0013. */ function IsPC(){ var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; } } return flag; } function Nav (){} Nav.prototype.menu_control = function (){ var bol = true; var _this = this; function nav(){ $(".mobileico a").on("click", function (ev){ var status = $(this).data("opened") if( !status ){ $(".nav").slideDown(); }else{ $(".nav").slideUp(); } $(this).data("opened", !status); return false; }); } nav(); $(window).on('resize', function (){ var isPc = IsPC(); if( isPc ){ $(".nav").show(); $(".mobileico a").data("opened", true); }else{ $(".nav").hide(); $(".mobileico a").data("opened", false); }; }); }