$(function(){ var browser = (function(){ var ua = window.navigator.useragent.tolowercase(), sys = null, s; if(s = ua.match(/rv:([\d.]+)\) like gecko/)){sys = {type:'ie',version:s[1]};} else if(s = ua.match(/msie ([\d.]+)/)){sys = {type:'ie',version:s[1]};} else if(s = ua.match(/firefox\/([\d.]+)/)){sys = {type:'firefox',version:s[1]};} else if(s = ua.match(/chrome\/([\d.]+)/)){sys = {type:'chrome',version:s[1]};} else if(s = ua.match(/opera.([\d.]+)/)){sys = {type:'opera',version:s[1]};} else if(s = ua.match(/version\/([\d.]+).*safari/)){sys = {type:'safari',version:s[1]};} else if(s = ua.match(/ucbrowser\/([\d.]+)/)){sys = {type:'uc',version:s[1]};} else if(s = ua.match(/micromessenger\/([\d.]+)/)){sys = {type:'wx',version:s[1]};} else{sys = {type:'unknown',version:'unknown'};} sys.ismobile = !!ua.match(/applewebkit.*mobile.*!/) || !!ua.match(/(iphone|ipod|android|ios|ipad)/i); return sys; })(); /*判断谷歌27*/ if(browser.type == 'chrome' && browser.version <= 27){ $('.font_scale8, .font_scale10').addclass('font_adjust'); } /*======返回顶部======*/ $(window).scroll(function() { var scroh = $(this).scrolltop(); if (scroh > 150) $('#to_top').fadein(300); else $('#to_top').fadeout(300); }) $('#to_top').click(function(){ $('body,html').animate({scrolltop:0},300); }) $('.indextwobox dl:nth-child(2n+1)').css({ marginright: '404px' }); $('.sidemenu ul li:last-child').css({ marginbottom: '15px' }); $('.photo ul li:nth-child(3n+1)').css({ marginleft: '0px' }); })