(function (a) { if (typeof define === "function" && define.amd) { define(["jquery"], a); } else { a(jQuery); } }(function (a) { a.fn.addBack = a.fn.addBack || a.fn.andSelf; a.fn.extend({ actual: function (b, l) { if (!this[b]) { throw '$.actual => The jQuery method "' + b + '" you called does not exist'; } var f = { absolute: false, clone: false, includeMargin: false, display: "block" }; var i = a.extend(f, l); var e = this.eq(0); var h, j; if (i.clone === true) { h = function () { var m = "position: absolute !important; top: -1000 !important; "; e = e.clone().attr("style", m).appendTo("body"); }; j = function () { e.remove(); }; } else { var g = []; var d = ""; var c; h = function () { c = e.parents().addBack().filter(":hidden"); d += "visibility: hidden !important; display: " + i.display + " !important; "; if (i.absolute === true) { d += "position: absolute !important; "; } c.each(function () { var m = a(this); var n = m.attr("style"); g.push(n); m.attr("style", n ? n + ";" + d : d); }); }; j = function () { c.each(function (m) { var o = a(this); var n = g[m]; if (n === undefined) { o.removeAttr("style"); } else { o.attr("style", n); } }); }; } h(); var k = /(outer)/.test(b) ? e[b](i.includeMargin) : e[b](); j(); return k; } }); })); ; (function ($, window, document) { "use strict"; var defaults = { deVal: 0, className: 'dataNums', digit: '' }; function rollNum(obj, options) { this.obj = obj; this.options = $.extend(defaults, options); this.init = function () { this.initHtml(obj, defaults); } } rollNum.prototype = { initHtml: function (obj, options) { var strHtml = '
'; obj.html(strHtml); } this.scroNum(obj, options); }, scroNum: function (obj, options) { var number = options.deVal; var $num_item = $(obj).find('.' + options.className).find('.tt'); var h = $(obj).find('.dataBoc').height(); $num_item.css('transition', 'all 2s ease-in-out'); var numberStr = number.toString(); if (numberStr.length <= $num_item.length - 1) { var tempStr = ''; for (var a = 0; a < $num_item.length - numberStr.length; a++) { tempStr += '0'; } numberStr = tempStr + numberStr; } var numberArr = numberStr.split(''); $num_item.each(function (i, item) { setTimeout(function () { $num_item.eq(i).css('top', -parseInt(numberArr[i]) * h - h * 10 + 'px'); }, i * 100) }); } } $.fn.rollNum = function (options) { var $that = this; var rollNumObj = new rollNum($that, options); rollNumObj.init(); }; })(jQuery, window, document); function pimg(id) { var _plist; if (id == null) { _plist = document.getElementsByClassName("_pimg") $('._pimg').each(function () { $(this).attr("_width", $(this).actual('width')); }); } else { _plist = document.getElementById(id.replace("#", "")).getElementsByClassName("_pimg") $(id).find('._pimg').each(function () { $(this).attr("_width", $(this).actual('width')); }); } var h = 0.1; for (var i = 0; i < _plist.length; i++) { h = pimgOnload(_plist[i], h); } } function pimgOnload(el, pheight) { try { var t = 0, d = 0, l = 0, r = 0; if (el.attributes["_m"]) { var m = el.attributes["_m"].value.trim().split(" "); switch (m.length) { case 1: t = m[0]; r = m[0]; d = m[0]; l = m[0]; break; case 2: t = m[0]; r = m[1]; d = m[0]; l = m[1]; break; case 3: t = m[0]; r = m[1]; d = m[2]; break; case 4: t = m[0]; r = m[1]; d = m[2]; l = m[3]; break; default: } } var width = el.offsetWidth; if (width == 0) width = el.attributes["_width"].value; var height = width / el.attributes["_w"].value * el.attributes["_h"].value; if (height > pheight) { if (height - pheight <= 0.5) { height = pheight; } } else if (pheight > height) { if (pheight - height <= 0.5) { height = pheight; } } el.style.height = height - t - d + "px"; el.style.marginBottom = d + "px"; el.style.marginTop = t + "px"; var img = el.getElementsByClassName("_img")[0]; var div = el.getElementsByClassName("_div")[0]; div.style.paddingBottom = height / width * 100 + "%"; div.style.width = width - l - r + "px"; div.style.marginLeft = l + "px"; img.setAttribute("_maxh", height); img.onload = function () { if (this.offsetHeight > 0) { var mheight = this.attributes["_maxh"].value; if (this.offsetHeight < mheight || this.attributes["_b"]) { this.style.width = this.offsetWidth * (mheight / this.offsetHeight) + "px"; this.style.height = mheight + "px"; this.setAttribute("_b", 0); } } } img.onload(); return height; } catch (e) { console.log("pimg错误", el) } return 0; } window.onresize = function () { pimg(null) AOS.refresh(); } function _baidumap(){ if ($('._mapbox').length > 0) { if (window.TILE_VERSION == undefined) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "http://api.map.baidu.com/getscript?v=2.0&ak=PGgBx2t0wST5E8OI3dmIYVrzLkurz1BW&services=&t=20140825185308"; document.getElementsByTagName('head')[0].appendChild(script); } for (var i = 0; i < $('._mapbox').length; i++) { $('._mapbox').eq(i).attr('id', "_mapcontent" + i); var style = document.createElement('style'); if ($('._mapbox').eq(i).find('style').length > 0) { style.innerHTML = $('._mapbox').eq(i).find('style').html().split('.').join("\r\n#_mapcontent" + i + " ."); document.getElementsByTagName('head')[0].appendChild(style); } _loadmap(i) } } } function pageInit() { pimg(null); _baidumap(); AOS.init({ easing: 'ease-out-sine', disable: 'mobile' }); } var _scrollot = null, _scroll_os = 0, _scroll_oe = 0, _scroll_h = 0; window.onscroll = function () { if (_scrollot == null) { _scrollot = $("._scrollot"); if (_scrollot.length > 0) { _scroll_os = _scrollot.attr("_s") * 0.01; _scroll_oe = _scrollot.attr("_e") * 0.01; _scroll_h = parseFloat(_scrollot.attr("_h")); } } if (_scrollot != null) { var scrollTop = parseFloat($(document).scrollTop()); if (scrollTop < _scroll_h) { if (_scroll_os < _scroll_oe) { var opacity = scrollTop / _scroll_h * (_scroll_oe - _scroll_os) + _scroll_os; _scrollot.css("opacity", opacity); } else if (_scroll_os > _scroll_oe) { var opacity = _scroll_os - (scrollTop / _scroll_h * (_scroll_os - _scroll_oe)); _scrollot.css("opacity", opacity); } } else { _scrollot.css("opacity", 1); } if (scrollTop > 50) { $("._s50h").hide(); $("._s50s").show(); } else if (scrollTop < 50) { $("._s50h").show(); $("._s50s").hide(); } if (scrollTop > 100) { $("._s100h").hide(); $("._s100s").show(); } else if (scrollTop < 100) { $("._s100h").show(); $("._s100s").hide(); } if (scrollTop > 150) { $("._s150h").hide(); $("._s150s").show(); } else if (scrollTop < 150) { $("._s150h").show(); $("._s150s").hide(); } if (scrollTop > 200) { $("._s200h").hide(); $("._s200s").show(); } else if (scrollTop < 200) { $("._s200h").show(); $("._s200s").hide(); } if (scrollTop > 250) { $("._s250h").hide(); $("._s250s").show(); } else if (scrollTop < 250) { $("._s250h").show(); $("._s250s").hide(); } if (scrollTop > 300) { $("._s300h").hide(); $("._s300s").show(); } else if (scrollTop < 300) { $("._s300h").show(); $("._s300s").hide(); } } } function _popup(_this) { var _html = _this.find('._html').html(); if ($('#_popup').length == 0) { var _popHtml = '