function getNewArticleList(id) { $.getJSON('/article/get-new-article-list', function (res) { var html = '' var data = res.data for (var i = 0; i < data.length; i++) { var item = data[i] html += '
  • ' + item.title + '

    ' + item.create_date + '

  • ' } id = id || 'new_article_list'; $('#' + id).append(html) }) } //---------------导航条--------------------- window.onload = function () { var index_nav = document.getElementById("index_nav"); var index_nav_ul = index_nav.getElementsByTagName("ul")[0]; var index_nav_li = index_nav_ul.children; for (var i = 1; i < index_nav_li.length; i++) { index_nav_li[i].index = i; if (index_nav_li[i].querySelector("ul")) { index_nav_li[i].onmousemove = function () { var this_ = this.querySelector("ul"); this_.style.display = "block"; startMove(this_, {opacity: 100}); } index_nav_li[i].onmouseleave = function () { var this_ = this.querySelector("ul"); this_.style.display = "none"; clearInterval(this_.timer); } } } } //---------------------------------------------------- if (document.getElementById("index_banner")) { var index_banner_oBox = document.getElementById('index_banner'); var index_banner_oUl = index_banner_oBox.getElementsByTagName('ul')[0]; var index_banner_aLi = index_banner_oUl.getElementsByTagName('li'); var index_banner_ico = document.getElementById('index_banner_ico').getElementsByTagName('a'); var index_banner_timer = null; var index_banner_ico_num = 0; index_banner_oUl.innerHTML += index_banner_oUl.innerHTML; function autoPlay() { if (index_banner_ico_num < index_banner_aLi.length - 1) { index_banner_ico_num++; } else { index_banner_ico_num = index_banner_aLi.length / 2; index_banner_oUl.style.bottom = -(index_banner_aLi[0].offsetHeight * (index_banner_aLi.length / 2 - 1)) + 'px'; } scroll(); } index_banner_timer = setInterval(autoPlay, 5000); for (var i = 0; i < index_banner_ico.length; i++) { index_banner_ico[i].index = i; index_banner_ico[i].onclick = function () { index_banner_ico_num = this.index; scroll(); } } function scroll() { startMove(index_banner_oUl, {bottom: -index_banner_aLi[0].offsetHeight * index_banner_ico_num}); for (var i = 0; i < index_banner_ico.length; i++) { index_banner_ico[i].className = ''; } index_banner_ico[index_banner_ico_num % index_banner_ico.length].className = 'index_banner_active'; } } //----------------------四大产品隐藏or显示------------- if (document.getElementById("index_products")) { var index_products = document.getElementById("index_products"); var index_products_li = index_products.getElementsByTagName("li"); var index_products_h1 = index_products.getElementsByTagName("h1"); var index_products_h3 = index_products.getElementsByTagName("h3"); var box = document.getElementById("index_banner_shape_01"); var logo = document.getElementById("index_logo"); for (var i = 0; i < index_products_li.length; i++) { index_products_li[i].index = i; index_products_li[i].onmouseenter = function () { startMove(index_products_h1[this.index], {paddingTop: 20}); startMove(index_products_h3[this.index], {opacity: 99}); } index_products_li[i].onmouseleave = function () { startMove(index_products_h1[this.index], {paddingTop: 75}); startMove(index_products_h3[this.index], {opacity: 0}); } } } $("#kefu_btn").click(function () { window.open('http://crm2.qq.com/page/portalpage/wpa.php?uin=800800642&aty=1&a=0&curl=&ty=1', '_blank', 'width=760,height=430,top=0px,left=0px'); }) //---------------首页扫描二维码下载软件------------ $("#index_android_ewm").hover(function () { $("#index_android_ewm_pic").fadeIn(); }, function () { $("#index_android_ewm_pic").hide() }) $("#index_ios_ewm").hover(function () { $("#index_ios_ewm_pic").fadeIn(); }, function () { $("#index_ios_ewm_pic").hide(); }) //-----------------------TAB切换--------------------- if (document.getElementById("index_tabs_list")) { var index_tab = document.getElementById("index_tabs_list"); var index_tab_ul = index_tab.getElementsByTagName("ul")[0]; var index_tab_li = index_tab_ul.getElementsByTagName("li"); var index_tab_main = document.getElementById("index_tabs_main"); var index_tab_ul = index_tab_main.getElementsByTagName("ul"); for (var i = 0; i < index_tab_li.length; i++) { index_tab_li[i].index = i; index_tab_li[i].onmouseover = function () { for (var i = 0; i < index_tab_li.length; i++) { index_tab_li[i].className = ""; index_tab_ul[i].style.display = "none"; } this.className = "index_tabs_active"; index_tab_ul[this.index].style.display = "block"; } } } //运动框架------------------------- function getStyle(obj, attr) { if (obj.currentStyle) { return obj.currentStyle[attr]; } else { return getComputedStyle(obj, false)[attr]; } } function startMove(obj, json, fn) { clearInterval(obj.timer); obj.timer = setInterval(function () { var bStop = true; for (var attr in json) { var iCur = 0; if (attr == 'opacity') { iCur = parseInt(parseFloat(getStyle(obj, attr)) * 100);//100 } else { iCur = parseInt(getStyle(obj, attr)); } var iSpeed = (json[attr] - iCur) / 8; iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed); if (iCur != json[attr]) { bStop = false; } if (attr == 'opacity') { obj.style.filter = 'alpha(opacity:' + (iCur + iSpeed) + ')'; obj.style.opacity = (iCur + iSpeed) / 100; } else { obj.style[attr] = iCur + iSpeed + 'px'; } } // console.log(iSpeed) if (bStop) { clearInterval(obj.timer); if (fn) { fn(); } } }, 20) } //-----------------首页数据提交------------------- function regsubmit_01(index_header_form) { var name_01_ = 'name_01', phone_01_ = 'phone_01', email_01_ = "email_01"; var form = $("#" + index_header_form); var name_01 = form.find("input[name =" + name_01_ + "]"); var phone_01 = form.find("input[name =" + phone_01_ + "]"); var email_01 = form.find("input[name =" + email_01_ + "]"); var status = 1; //检查昵称 if (name_01.val() != undefined) { if (name_01.val() == "") { layer_tips("姓名不能为空", name_01); name_01.focus(); status = 0; return false; } if (name_01.val().match(regexEnum.chinese) == null) { layer_tips("只能为汉字,如有疑问请咨询客服", name_01); name_01.focus(); status = 0; return false; } } //console.log(phone_01.val()) //检查手机号码 if (phone_01.val() != undefined) { if (phone_01.val() == "") { layer_tips("手机号码不能为空", phone_01); phone_01.focus(); status = 0; return false; } if (phone_01.val().match(regexEnum.mobile) == null) { layer_tips("号码格式错误,如有疑问请咨询客服", phone_01); phone_01.focus(); status = 0; return false; } } //检查邮箱 if (email_01.val() != undefined) { if (email_01.val() == "") { layer_tips("请输入正确的邮箱,如有疑问请咨询客服", email_01); email_01.focus(); status = 0; return false; } if (email_01.val().match(regexEnum.email) == null) { layer_tips("邮箱格式错误,如有疑问请咨询客服", email_01); email_01.focus(); status = 0; return false; } } //提交表单的网址------------------------------------------------ if (status == 1) { var posturl = "/api/save-register";//提交表单的网址 var postparam = { "name": name_01.val(), "mobile": phone_01.val(), "email": email_01.val() // "ip":returnCitySN["cip"] } $.ajax({ type: "POST", data: postparam, url: posturl, async: false, dataType: "json", success: function (data) { if (data) { //清空表单 if (name_01.val() != undefined) { name_01.val(""); } if (phone_01.val() != undefined) { phone_01.val(""); } if (email_01.val() != undefined) { email_01.val(""); } layer.msg( '恭喜您!您的申请已成功提交' + "
    " + '请保持电话畅通,稍后我们会有客服为您提供服务。', {time: 4000}, function () { window.location.href = "" + window.location.pathname + ""; } ); } else { } } }); } } function regsubmit_02(index_bottom_form) { var name_02_ = 'name_02', phone_02_ = 'phone_02', email_02_ = "email_02"; var form = $("#" + index_bottom_form); var name_02 = form.find("input[name =" + name_02_ + "]"); var phone_02 = form.find("input[name =" + phone_02_ + "]"); var email_02 = form.find("input[name =" + email_02_ + "]"); var status = 1; //检查昵称 if (name_02.val() != undefined) { if (name_02.val() == "") { layer_tips("请输入您的姓名", name_02); name_02.focus(); status = 0; return false; } if (name_02.val().match(regexEnum.chinese) == null) { layer_tips("只能为汉字,如有疑问请咨询客服", name_02); name.focus(); status = 0; return false; } } //检查手机号码 if (phone_02.val() != undefined) { if (phone_02.val() == "") { layer_tips("请输入手机号码", phone_02); phone_02.focus(); status = 0; return false; } if (phone_02.val().match(regexEnum.mobile) == null) { layer_tips("手机号码格式错误,如有疑问请咨询客服", phone_02); phone_02.focus(); status = 0; return false; } } //console.log("name_02.val" + "--------------" + name_02.val()) //检查邮箱 if (email_02.val() != undefined) { if (email_02.val() == "") { layer_tips("请输入正确的邮箱,如有疑问请咨询客服", email_02); email_02.focus(); status = 0; return false; } if (email_02.val().match(regexEnum.email) == null) { layer_tips("邮箱格式错误,如有疑问请咨询客服", email_02); email_02.focus(); status = 0; return false; } } if (status == 1) { var posturl = "/api/save-register";//提交表单的网址 var postparam = { "name": name_02.val(), "mobile": phone_02.val(), "email": email_02.val() // "ip":returnCitySN["cip"] } $.ajax({ type: "POST", data: postparam, url: posturl, async: false, dataType: "json", success: function (data) { if (data) { //清空表单 if (name_02.val() != undefined) { name_02.val(""); } if (phone_02.val() != undefined) { phone_02.val(""); } if (email_02.val() != undefined) { email_02.val(""); } layer.msg( '恭喜您!您的申请已成功提交' + "
    " + '请保持电话畅通,稍后我们会有客服为您提供服务。', {time: 4000}, function () { window.location.href = "" + window.location.pathname + ""; } ); } else { } } }); } } //------------------客户端下载------------------ $("#download_ewm_and").mouseover(function () { $("#download_ewm_android").fadeIn(1000); }) $("#download_ewm_and").mouseout(function () { $("#download_ewm_android").fadeOut(1000); }) $("#download_ewm_ios").mouseover(function () { $("#download_ewm_ios_pic").fadeIn(1000); }) $("#download_ewm_ios").mouseout(function () { $("#download_ewm_ios_pic").fadeOut(1000); }) $(".download_btn_left").mouseover(function () { $(".download_btn_left_ewm").fadeIn(1000); }) $(".download_btn_left").mouseout(function () { $(".download_btn_left_ewm").fadeOut(1000); }) //-----------右边的快速导航---------- //sidebar $(".sidebar-box li").hover(function () { $(this).children("div").clearQueue().animate({ width: "202" }); }, function () { $(this).children("div").clearQueue().animate({ width: "0" }); }); //---------------弹框--------------------- var regexEnum = { email: "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", //邮件 chinese: "^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$", //仅中文 mobile: "^1[3|4|5|7|8][0-9]\\d{8}$", //最新的手机号码 qq: "^[1-9]*[1-9][0-9]*$", //QQ号码 ps_username: "^[\\u4E00-\\u9FA5\\uF900-\\uFA2D_\\w]+$", //中文、字母、数字 _ weixin: "^[a-zA-Z0-9_-]{5,19}$" //微信 } //弹出新窗口 function layer_openwin(url, width, height, title) { var param = "&spetitle=" + document.title; if (!width) width = "660px"; if (!height) height = "600px"; layer.open({ type: 2, title: " ", shadeClose: true, shade: 0.8, area: [width, height], content: url + param }); } //弹出提示窗口 function layer_alert(msg) { layer.alert(msg, {skin: 'layui-layer-lan'}); } //消息提示窗口 function layer_msg(msg) { layer.msg(msg); } //tip提示 function layer_tips(msg, id) { layer.tips(msg, id, {tips: [1]}); } function layer_loading() { var index = layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }); } //图片弹出框 function layer_popimg(id, i) { layer.open({ type: 1, title: false, closeBtn: false, area: ['auto', 'auto'], skin: 'layui-layer-nobg', //没有背景色 shadeClose: true, content: $('#imgViewBig_' + id + '_' + i) }); } //内容层 function layer_page(cnt, title, width, height) { if (!title) title = " "; if (!width) width = "650px"; if (!height) height = "600px"; layer.open({ type: 1, title: title, shadeClose: true, skin: 'layui-layer-rim', area: [width, height], content: "
    " + cnt + "
    " }); } //表单验证 function layer_validate(dom, text, regex) { var DOMval = $(dom).val(); if (regex) { //如果正则不为空,dom存在内容,则验证。 var r = DOMval.match(regex); if (r == null) { layer_tips(text, $(dom)); $(dom).focus(); return false; } } else {//如果不填写正则,验证是否为空 if (!DOMval) { layer_tips(text, $(dom)); $(dom).focus(); return false; } } } //------------------------------------- //---------活动专题------------------ $("#list").height($("#huodongyugao li").length * 235); $("#project_banner_tab_right").click(function () { $("#huodongyugao").css("display", "none"); $("#aikehuodong").css("display", "block"); $("#project_banner_tab_right").addClass("active"); $("#project_banner_tab_left").removeClass("active"); $("#list_02").height($("#aikehuodong li").length * 235); }) $("#project_banner_tab_left").click(function () { $("#huodongyugao").css("display", "block"); $("#aikehuodong").css("display", "none"); $("#project_banner_tab_left").addClass("active"); $("#project_banner_tab_right").removeClass("active"); }) //------------------账户类型------------------ $("#account_banner_tab li").click(function () { var i = $(this).index(); $(this).addClass("active").siblings().removeClass("active"); $('#account_tab >div').eq(i).show().siblings().hide(); }) //------------------交易平台------------------ $("#download_banner_tab li").click(function () { var i = $(this).index(); $(this).addClass("active").siblings().removeClass("active"); $('#download_tab >div').eq(i).show().siblings().hide(); }) //----------------------------- /*! layer-v1.9.0 弹层组件 License LGPL http://sentsin.com/jquery/layer/ */ ;!function (a, b) { "use strict"; var c, d, e = { getPath: function () { var a = document.scripts, b = a[a.length - 1].src; return b.substring(0, b.lastIndexOf("/") + 1) }(), config: {}, end: {}, btn: ["确定", "取消"], type: ["dialog", "page", "iframe", "loading", "tips"] }; a.layer = { v: "1.9.0", ie6: !!a.ActiveXObject && !a.XMLHttpRequest, index: 0, path: e.getPath, config: function (a, b) { var d = 0; return a = a || {}, e.config = c.extend(e.config, a), layer.path = e.config.path || layer.path, "string" == typeof a.extend && (a.extend = [a.extend]), layer.use("../css/layer.css", a.extend && a.extend.length > 0 ? function f() { var c = a.extend; layer.use(c[c[d] ? d : d - 1], d < c.length ? function () { return ++d, f }() : b) }() : b), this }, use: function (a, b, d) { var e = c("head")[0], a = a.replace(/\s/g, ""), f = /\.css$/.test(a), g = document.createElement(f ? "link" : "script"), h = "layui_layer_" + a.replace(/\.|\//g, ""); return f && (g.rel = "stylesheet"), g[f ? "href" : "src"] = /^http:\/\//.test(a) ? a : layer.path + a, g.id = h, c("#" + h)[0] || e.appendChild(g), function i() { (f ? 1989 === parseInt(c("#" + h).css("width")) : layer[d || h]) ? function () { b && b(); try { f || e.removeChild(g) } catch (a) { } }() : setTimeout(i, 100) }(), this }, ready: function (a, b) { var d = "function" == typeof a; return d && (b = a), layer.config(c.extend(e.config, function () { return d ? {} : {path: a} }()), b), this }, alert: function (a, b, d) { var e = "function" == typeof b; return e && (d = b), layer.open(c.extend({content: a, yes: d}, e ? {} : b)) }, confirm: function (a, b, d, f) { var g = "function" == typeof b; return g && (f = d, d = b), layer.open(c.extend({content: a, btn: e.btn, yes: d, cancel: f}, g ? {} : b)) }, msg: function (a, d, e) { var f = "function" == typeof d, h = "layui-layer-msg", i = g.anim.length - 1; return f && (e = d), layer.open(c.extend({ content: a, time: 3e3, shade: !1, skin: h, title: !1, closeBtn: !1, btn: !1, end: e }, f ? {skin: h + " layui-layer-hui", shift: i} : function () { return d = d || {}, (-1 === d.icon || d.icon === b) && (d.skin = h + " " + (d.skin || "layui-layer-hui")), d }())) }, load: function (a, b) { return layer.open(c.extend({type: 3, icon: a || 0, shade: .01}, b)) }, tips: function (a, b, d) { return layer.open(c.extend({type: 4, content: [a, b], closeBtn: !1, time: 3e3, maxWidth: 210}, d)) } }; var f = function (a) { var b = this; b.index = ++layer.index, b.config = c.extend({}, b.config, a, e.config), b.creat() }; f.pt = f.prototype; var g = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe", "layui-layer-content", "layui-layer-btn", "layui-layer-close"]; g.anim = ["layui-anim-01", "layui-anim-02", "layui-anim-03", "layui-anim-04", "layui-anim-05", "layui-anim-06", "layui-anim-07"], f.pt.config = { type: 0, shade: .3, fix: !0, move: g[1], title: "信息", offset: "auto", area: "auto", closeBtn: 1, time: 0, zIndex: 19891014, maxWidth: 360, shift: 0, icon: -1, scrollbar: !0, tips: 2 }, f.pt.vessel = function (a, b) { var c = this, d = c.index, f = c.config, h = f.zIndex + d, i = "object" == typeof f.title, j = !(!f.maxmin || 1 !== f.type && 2 !== f.type || /^\d+%$/.test(f.area[0]) && /^\d+%$/.test(f.area[1])), k = f.title ? '
    ' + (i ? f.title[0] : f.title) + "
    " : ""; return f.zIndex = h, b([f.shade ? '
    ' : "", '
    ' + (a && 2 != f.type ? "" : k) + '
    ' + (0 == f.type && -1 !== f.icon ? '' : "") + (1 == f.type && a ? "" : f.content || "") + '
    ' + function () { var a = j ? '' : ""; return f.closeBtn && (a += ''), a }() + "" + (f.btn ? function () { var a = ""; "string" == typeof f.btn && (f.btn = [f.btn]); for (var b = 0, c = f.btn.length; c > b; b++) a += '' + f.btn[b] + ""; return '
    ' + a + "
    " }() : "") + "
    "], k), c }, f.pt.creat = function () { var a = this, b = a.config, f = a.index, h = b.content, i = "object" == typeof h; switch ("string" == typeof b.area && (b.area = "auto" === b.area ? ["", ""] : [b.area, ""]), b.type) { case 0: b.btn = "btn" in b ? b.btn : e.btn[0], layer.close(c("div." + g[0] + "[type=dialog]").attr("times")); break; case 2: var h = b.content = i ? b.content : [b.content || "http://sentsin.com?from=layer", "auto"]; b.content = ''; break; case 3: b.title = !1, b.closeBtn = !1, -1 === b.icon && 0 === b.icon, layer.closeAll("loading"); break; case 4: i || (b.content = [b.content, "body"]), b.follow = b.content[1], b.content = b.content[0] + '', b.title = !1, b.shade = !1, b.fix = !1, b.tips = "object" == typeof b.tips ? b.tips : [b.tips, !0], b.tipsMore || layer.closeAll("tips") } a.vessel(i, function (d, e) { c("body").append(d[0]), i ? function () { 2 == b.type || 4 == b.type ? function () { c("body").append(d[1]) }() : function () { h.parents("." + g[0])[0] || (h.show().addClass("layui-layer-wrap").wrap(d[1]), c("#" + g[0] + f).find("." + g[5]).before(e)) }() }() : c("body").append(d[1]), a.layero = c("#" + g[0] + f), b.scrollbar || g.html.css("overflow", "hidden").attr("layer-full", f) }).auto(f), 2 == b.type && layer.ie6 && a.layero.find("iframe").attr("src", h[0]), 4 == b.type ? a.tips() : a.offset(), b.fix && d.on("resize", function () { a.offset(), (/^\d+%$/.test(b.area[0]) || /^\d+%$/.test(b.area[1])) && a.auto(f), 4 == b.type && a.tips() }), b.time <= 0 || setTimeout(function () { layer.close(a.index) }, b.time), a.move().callback() }, f.pt.auto = function (a) { function b(a) { a = h.find(a), a.height(i[1] - j - k - 2 * (0 | parseFloat(a.css("padding")))) } var e = this, f = e.config, h = c("#" + g[0] + a); "" === f.area[0] && f.maxWidth > 0 && (/MSIE 7/.test(navigator.userAgent) && f.btn && h.width(h.innerWidth()), h.outerWidth() > f.maxWidth && h.width(f.maxWidth)); var i = [h.innerWidth(), h.innerHeight()], j = h.find(g[1]).outerHeight() || 0, k = h.find("." + g[6]).outerHeight() || 0; switch (f.type) { case 2: b("iframe"); break; default: "" === f.area[1] ? f.fix && i[1] > d.height() && (i[1] = d.height(), b("." + g[5])) : b("." + g[5]) } return e }, f.pt.offset = function () { var a = this, b = a.config, c = a.layero, e = [c.outerWidth(), c.outerHeight()], f = "object" == typeof b.offset; a.offsetTop = (d.height() - e[1]) / 2, a.offsetLeft = (d.width() - e[0]) / 2, f ? (a.offsetTop = b.offset[0], a.offsetLeft = b.offset[1]) : "auto" !== b.offset && (a.offsetTop = b.offset, "rb" === b.offset && (a.offsetTop = d.height() - e[1], a.offsetLeft = d.width() - e[0])), b.fix || (a.offsetTop += d.scrollTop(), a.offsetLeft += d.scrollLeft()), c.css({ top: a.offsetTop, left: a.offsetLeft }) }, f.pt.tips = function () { var a = this, b = a.config, e = a.layero, f = [e.outerWidth(), e.outerHeight()], h = c(b.follow); h[0] || (h = c("body")); var i = {width: h.outerWidth(), height: h.outerHeight(), top: h.offset().top, left: h.offset().left}, j = e.find(".layui-layer-TipsG"), k = b.tips[0]; b.tips[1] || j.remove(), i.autoLeft = function () { i.left + f[0] - d.width() > 0 ? (i.tipLeft = i.left + i.width - f[0], j.css({ right: 12, left: "auto" })) : i.tipLeft = i.left }, i.where = [function () { i.autoLeft(), i.tipTop = i.top - f[1] - 10, j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color", b.tips[1]) }, function () { i.tipLeft = i.left + i.width + 10, i.tipTop = i.top, j.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color", b.tips[1]) }, function () { i.autoLeft(), i.tipTop = i.top + i.height + 10, j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color", b.tips[1]) }, function () { i.tipLeft = i.left - f[0] - 10, i.tipTop = i.top, j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color", b.tips[1]) }], i.where[k - 1](), 1 === k ? i.top - (d.scrollTop() + f[1] + 16) < 0 && i.where[2]() : 2 === k ? d.width() - (i.left + i.width + f[0] + 16) > 0 || i.where[3]() : 3 === k ? i.top - d.scrollTop() + i.height + f[1] + 16 - d.height() > 0 && i.where[0]() : 4 === k && f[0] + 16 - i.left > 0 && i.where[1](), e.find("." + g[5]).css({ "background-color": b.tips[1], "padding-right": b.closeBtn ? "30px" : "" }), e.css({left: i.tipLeft, top: i.tipTop}) }, f.pt.move = function () { var a = this, b = a.config, e = { setY: 0, moveLayer: function () { var a = e.layero, b = parseInt(a.css("margin-left")), c = parseInt(e.move.css("left")); 0 === b || (c -= b), "fixed" !== a.css("position") && (c -= a.parent().offset().left, e.setY = 0), a.css({ left: c, top: parseInt(e.move.css("top")) - e.setY }) } }, f = a.layero.find(b.move); return b.move && f.attr("move", "ok"), f.css({cursor: b.move ? "move" : "auto"}), c(b.move).on("mousedown", function (a) { if (a.preventDefault(), "ok" === c(this).attr("move")) { e.ismove = !0, e.layero = c(this).parents("." + g[0]); var f = e.layero.offset().left, h = e.layero.offset().top, i = e.layero.width() - 6, j = e.layero.height() - 6; c("#layui-layer-moves")[0] || c("body").append('
    '), e.move = c("#layui-layer-moves"), b.moveType && e.move.css({visibility: "hidden"}), e.moveX = a.pageX - e.move.position().left, e.moveY = a.pageY - e.move.position().top, "fixed" !== e.layero.css("position") || (e.setY = d.scrollTop()) } }), c(document).mousemove(function (a) { if (e.ismove) { var c = a.pageX - e.moveX, f = a.pageY - e.moveY; if (a.preventDefault(), !b.moveOut) { e.setY = d.scrollTop(); var g = d.width() - e.move.outerWidth(), h = e.setY; 0 > c && (c = 0), c > g && (c = g), h > f && (f = h), f > d.height() - e.move.outerHeight() + e.setY && (f = d.height() - e.move.outerHeight() + e.setY) } e.move.css({left: c, top: f}), b.moveType && e.moveLayer(), c = f = g = h = null } }).mouseup(function () { try { e.ismove && (e.moveLayer(), e.move.remove()), e.ismove = !1 } catch (a) { e.ismove = !1 } b.moveEnd && b.moveEnd() }), a }, f.pt.callback = function () { var a = this, b = a.layero, d = a.config; a.openLayer(), d.success && (2 == d.type ? b.find("iframe")[0].onload = function () { this.className = "", d.success(b, a.index) } : d.success(b, a.index)), layer.ie6 && a.IE6(b), b.find("." + g[6] + "0").on("click", function () { d.yes ? d.yes(a.index) : layer.close(a.index) }), b.find("." + g[7] + ",." + g[6] + "1").on("click", function () { d.cancel && d.cancel(a.index), layer.close(a.index) }), d.shadeClose && c("#layui-layer-shade" + a.index).on("click", function () { layer.close(a.index) }), b.find(".layui-layer-min").on("click", function () { layer.min(a.index, d), d.min && d.min(b) }), b.find(".layui-layer-max").on("click", function () { c(this).hasClass("layui-layer-maxmin") ? (layer.restore(a.index), d.restore && d.restore(b)) : (layer.full(a.index, d), d.full && d.full(b)) }), d.end && (e.end[a.index] = d.end) }, e.reselect = function () { c.each(c("select"), function () { var a = c(this); a.parents("." + g[0])[0] || 1 == a.attr("layer") && c("." + g[0]).length < 1 && a.removeAttr("layer").show(), a = null }) }, f.pt.IE6 = function (a) { function b() { a.css({top: f + (e.config.fix ? d.scrollTop() : 0)}) } var e = this, f = a.offset().top; b(), d.scroll(b), c("select").each(function () { var a = c(this); a.parents("." + g[0])[0] || "none" === a.css("display") || a.attr({layer: "1"}).hide(), a = null }) }, f.pt.openLayer = function () { var a = this; layer.zIndex = a.config.zIndex, layer.setTop = function (a) { var b = function () { layer.zIndex++, a.css("z-index", layer.zIndex + 1) }; return layer.zIndex = parseInt(a[0].style.zIndex), a.on("mousedown", b), layer.zIndex } }, e.record = function (a) { var b = [a.outerWidth(), a.outerHeight(), a.position().top, a.position().left + parseFloat(a.css("margin-left"))]; a.find(".layui-layer-max").addClass("layui-layer-maxmin"), a.attr({area: b}) }, e.rescollbar = function (a) { g.html.attr("layer-full") == a && (g.html[0].style.removeProperty ? g.html[0].style.removeProperty("overflow") : g.html[0].style.removeAttribute("overflow"), g.html.removeAttr("layer-full")) }, layer.getChildFrame = function (a, b) { return b = b || c("." + g[4]).attr("times"), c("#" + g[0] + b).find("iframe").contents().find(a) }, layer.getFrameIndex = function (a) { return c("#" + a).parents("." + g[4]).attr("times") }, layer.iframeAuto = function (a) { if (a) { var b = layer.getChildFrame("body", a).outerHeight(), d = c("#" + g[0] + a), e = d.find(g[1]).outerHeight() || 0, f = d.find("." + g[6]).outerHeight() || 0; d.css({height: b + e + f}), d.find("iframe").css({height: b}) } }, layer.iframeSrc = function (a, b) { c("#" + g[0] + a).find("iframe").attr("src", b) }, layer.style = function (a, b) { var d = c("#" + g[0] + a), f = d.attr("type"), h = d.find(g[1]).outerHeight() || 0, i = d.find("." + g[6]).outerHeight() || 0; (f === e.type[1] || f === e.type[2]) && (d.css(b), f === e.type[2] && d.find("iframe").css({height: parseFloat(b.height) - h - i})) }, layer.min = function (a) { var b = c("#" + g[0] + a), d = b.find(g[1]).outerHeight() || 0; e.record(b), layer.style(a, { width: 180, height: d }), b.find(".layui-layer-min").hide(), "page" === b.attr("type") && b.find(g[4]).hide(), e.rescollbar(a) }, layer.restore = function (a) { { var b = c("#" + g[0] + a), d = b.attr("area").split(","); b.attr("type") } layer.style(a, { width: parseFloat(d[0]), height: parseFloat(d[1]), top: parseFloat(d[2]), left: parseFloat(d[3]) }), b.find(".layui-layer-max").removeClass("layui-layer-maxmin"), b.find(".layui-layer-min").show(), "page" === b.attr("type") && b.find(g[4]).show(), e.rescollbar(a) }, layer.full = function (a) { var b, f = c("#" + g[0] + a); e.record(f), g.html.attr("layer-full") || g.html.css("overflow", "hidden").attr("layer-full", a), clearTimeout(b), b = setTimeout(function () { var b = "fixed" === f.css("position"); layer.style(a, { top: b ? 0 : d.scrollTop(), left: b ? 0 : d.scrollLeft(), width: d.width(), height: d.height() }), f.find(".layui-layer-min").hide() }, 100) }, layer.title = function (a, b) { var d = c("#" + g[0] + (b || layer.index)).find(g[1]); d.html(a) }, layer.close = function (a) { var b = c("#" + g[0] + a), d = b.attr("type"); if (b[0]) { if (d === e.type[1] && "object" === b.attr("conType")) { b.children(":not(." + g[5] + ")").remove(); for (var f = 0; 2 > f; f++) b.find(".layui-layer-wrap").unwrap().hide() } else { if (d === e.type[2]) try { var h = c("#" + g[4] + a)[0]; h.contentWindow.document.write(""), h.contentWindow.close(), b.find("." + g[5])[0].removeChild(h) } catch (i) { } b[0].innerHTML = "", b.remove() } c("#layui-layer-moves, #layui-layer-shade" + a).remove(), layer.ie6 && e.reselect(), e.rescollbar(a), "function" == typeof e.end[a] && e.end[a](), delete e.end[a] } }, layer.closeAll = function (a) { c.each(c("." + g[0]), function () { var b = c(this), d = a ? b.attr("type") === a : 1; d && layer.close(b.attr("times")), d = null }) }, e.run = function () { c = jQuery, d = c(a), g.html = c("html"), layer.open = function (a) { var b = new f(a); return b.index } }, "function" == typeof define ? define(function () { return e.run(), layer }) : function () { e.run(), layer.use("../css/layer.css") }() }(window); /*! http://mths.be/placeholder v2.0.7 by @mathias */ ;(function (f, h, $) { var a = 'placeholder' in h.createElement('input'), d = 'placeholder' in h.createElement('textarea'), i = $.fn, c = $.valHooks, k, j; if (a && d) { j = i.placeholder = function () { return this }; j.input = j.textarea = true } else { j = i.placeholder = function () { var l = this; l.filter((a ? 'textarea' : ':input') + '[placeholder]').not('.placeholder').bind({ 'focus.placeholder': b, 'blur.placeholder': e }).data('placeholder-enabled', true).trigger('blur.placeholder'); return l }; j.input = a; j.textarea = d; k = { get: function (m) { var l = $(m); return l.data('placeholder-enabled') && l.hasClass('placeholder') ? '' : m.value }, set: function (m, n) { var l = $(m); if (!l.data('placeholder-enabled')) { return m.value = n } if (n == '') { m.value = n; if (m != h.activeElement) { e.call(m) } } else { if (l.hasClass('placeholder')) { b.call(m, true, n) || (m.value = n) } else { m.value = n } } return l } }; a || (c.input = k); d || (c.textarea = k); $(function () { $(h).delegate('form', 'submit.placeholder', function () { var l = $('.placeholder', this).each(b); setTimeout(function () { l.each(e) }, 10) }) }); $(f).bind('beforeunload.placeholder', function () { $('.placeholder').each(function () { this.value = '' }) }) } function g(m) { var l = {}, n = /^jQuery\d+$/; $.each(m.attributes, function (p, o) { if (o.specified && !n.test(o.name)) { l[o.name] = o.value } }); return l } function b(m, n) { var l = this, o = $(l); if (l.value == o.attr('placeholder') && o.hasClass('placeholder')) { if (o.data('placeholder-password')) { o = o.hide().next().show().attr('id', o.removeAttr('id').data('placeholder-id')); if (m === true) { return o[0].value = n } o.focus() } else { l.value = ''; o.removeClass('placeholder'); l == h.activeElement && l.select() } } } function e() { var q, l = this, p = $(l), m = p, o = this.id; if (l.value == '') { if (l.type == 'password') { if (!p.data('placeholder-textinput')) { try { q = p.clone().attr({type: 'text'}) } catch (n) { q = $('').attr($.extend(g(this), {type: 'text'})) } q.removeAttr('name').data({ 'placeholder-password': true, 'placeholder-id': o }).bind('focus.placeholder', b); p.data({'placeholder-textinput': q, 'placeholder-id': o}).before(q) } p = p.removeAttr('id').hide().prev().attr('id', o).show() } p.addClass('placeholder'); p[0].value = p.attr('placeholder') } else { p.removeClass('placeholder') } } }(this, document, jQuery));