// 动画效果 new wow().init(); ieversion(); // 判断ie function ieversion() { var useragent = navigator.useragent; //取得浏览器的useragent字符串 var isie = useragent.indexof("compatible") > -1 && useragent.indexof("msie") > -1; //判断是否ie<11浏览器 var isedge = useragent.indexof("edge") > -1 && !isie; //判断是否ie的edge浏览器 var isie11 = useragent.indexof('trident') > -1 && useragent.indexof("rv:11.0") > -1; // document.body.style.opacity = 0; document.body.style.display = 'none'; if (isie) { var reie = new regexp("msie (\\d+\\.\\d+);"); reie.test(useragent); var fieversion = parsefloat(regexp["$1"]); console.log(fieversion) if (fieversion == 7) { $("html").addclass("browsers"); } else if (fieversion == 8) { $("html").addclass("browsers"); } else if (fieversion == 9) { $("html").addclass("browsers"); } else if (fieversion == 10) { $("html").addclass("browsers"); return 10; } else { $("html").addclass("browsers"); } } else if (isedge) { // document.body.style.opacity = 1; document.body.style.display = "block"; return 'edge'; //edge } else if (isie11) { // document.body.style.opacity = 1; document.body.style.display = "block"; return 11; //ie11 } else { // document.body.style.opacity = 1; document.body.style.display = "block"; return -1; //不是ie浏览器 } } // 一个参数 function ajax(url, id) { var ajax = $.ajax({ url: url, async: false, data: { id: id } }); $("#list-ajax").html(ajax.responsetext); }; // 搜索 function ajaxsearch(url, val) { var ajax = $.ajax({ url: url, async: false, data: { val: val } }); $('.ajax-search input').val(''); $("#list-ajax").html(ajax.responsetext); }; // 带搜索 function ajaxval(url, id, val) { var ajax = $.ajax({ url: url, async: false, data: { id: id, val: val } }); $('.ajax-search input').val(''); $("#list-ajax").html(ajax.responsetext); }; // 分页 function page(url, sum) { p += 1; var ajax = $.ajax({ url: newurl, data: { page: p }, cache: false, datatype: 'html', beforesend: function() {}, success: function(html) { $("#page-box").append(html); } }); if (p == sum - 1) { $(".page-btn").hide(); } return false; }; // 一个参数的搜索 function pagetab(url, id, sum) { $("#page-box").fadein(3000); p += 1; var ajax = $.ajax({ url: newurl, data: { page: p, id: id }, cache: false, datatype: 'html', beforesend: function() {}, success: function(html) { $("#page-box").append(html); } }); if (p == sum - 1) { $(".page-btn").hide(); } return false; }; // 滚动效果 function scroll(num) { $('html,body').stop().animate({scrolltop:$('#list-box').offset().top - num},800); } function scrolla(num) { $('html,body').animate({ scrolltop: ($($(this).attr('href')).offset().top - num) }, 1000) }