//发送留言 function sendleaveword_index(src) { var scontact = $("#txtcontact").val(); var smobile = $("#txtmobile").val(); var sshortdesc = $("#txtshortdesc").val(); var sfrompage = $('#frompage').text(); if (scontact == "") { alert("请输入您的姓名"); return ""; } if (smobile == "") { alert("请输入您的手机号码"); return ""; } else if (smobile.length > 0 && !ptn_tel.test(smobile)) { alert("您的手机号码格式错误"); return ""; } $.post("/mobile/ajax/ajax.ashx?action=sendleaveword_index&t=" + math.random(), { title: "在线留言",//标题 comp: "",//公司名称 tel: "",//座机号码 contact: scontact,//联系人 mobile: smobile,//手机号码 email: "", shortdesc: sshortdesc, formid: "9",//表单编号 attributevalues: "留言页面=" + sfrompage + "&联系人=" + scontact + "&联系电话=" + smobile + "&建筑类型=" +sshortdesc + "" //字段中文名称以英文&分割 }, function (msg) { var sta = gav(msg, "state"); var smsg = gav(msg, "msg"); if (sta == "1") { alert("留言提交成功"); $("#txtcontact").val(""); $("#txtmobile").val(""); $("#txtshortdesc").val(""); } else { if (smsg == "") { smsg = "提交失败,请稍后再试,勿频繁提交!"; } else { $("#txtcontact").val(""); $("#txtmobile").val(""); $("#txtshortdesc").val(""); } alert(smsg); } }); } //flexible (function (win, lib) { var doc = win.document; var docel = doc.documentelement; var metael = doc.queryselector('meta[name="viewport"]'); var flexibleel = doc.queryselector('meta[name="flexible"]'); var dpr = 0; var scale = 0; var tid; var flexible = lib.flexible || (lib.flexible = {}); if (metael) { console.warn('将根据已有的meta标签来设置缩放比例'); var match = metael.getattribute('content').match(/initial\-scale=([\d\.]+)/); if (match) { scale = parsefloat(match[1]); dpr = parseint(1 / scale); } } else if (flexibleel) { var content = flexibleel.getattribute('content'); if (content) { var initialdpr = content.match(/initial\-dpr=([\d\.]+)/); var maximumdpr = content.match(/maximum\-dpr=([\d\.]+)/); if (initialdpr) { dpr = parsefloat(initialdpr[1]); scale = parsefloat((1 / dpr).tofixed(2)); } if (maximumdpr) { dpr = parsefloat(maximumdpr[1]); scale = parsefloat((1 / dpr).tofixed(2)); } } } if (!dpr && !scale) { var isandroid = win.navigator.appversion.match(/android/gi); var isiphone = win.navigator.appversion.match(/iphone/gi); var devicepixelratio = win.devicepixelratio; if (isiphone) { // ios下,对于2和3的屏,用2倍的方案,其余的用1倍方案 if (devicepixelratio >= 3 && (!dpr || dpr >= 3)) { dpr = 3; } else if (devicepixelratio >= 2 && (!dpr || dpr >= 2)) { dpr = 2; } else { dpr = 1; } } else { // 其他设备下,仍旧使用1倍的方案 dpr = 1; } scale = 1 / dpr; } docel.setattribute('data-dpr', dpr); if (!metael) { metael = doc.createelement('meta'); metael.setattribute('name', 'viewport'); metael.setattribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no'); if (docel.firstelementchild) { docel.firstelementchild.appendchild(metael); } else { var wrap = doc.createelement('div'); wrap.appendchild(metael); doc.write(wrap.innerhtml); } } function refreshrem() { var width = docel.getboundingclientrect().width; if (width / dpr > 768) { width = 768 * dpr; } var rem = width / 10; docel.style.fontsize = rem + 'px'; flexible.rem = win.rem = rem; } win.addeventlistener('resize', function () { cleartimeout(tid); tid = settimeout(refreshrem, 300); }, false); win.addeventlistener('pageshow', function (e) { if (e.persisted) { cleartimeout(tid); tid = settimeout(refreshrem, 300); } }, false); if (doc.readystate === 'complete') { doc.body.style.fontsize = 12 * dpr + 'px'; } else { doc.addeventlistener('domcontentloaded', function (e) { doc.body.style.fontsize = 12 * dpr + 'px'; }, false); } refreshrem(); flexible.dpr = win.dpr = dpr; flexible.refreshrem = refreshrem; flexible.rem2px = function (d) { var val = parsefloat(d) * this.rem; if (typeof d === 'string' && d.match(/rem$/)) { val += 'px'; } return val; } flexible.px2rem = function (d) { var val = parsefloat(d) / this.rem; if (typeof d === 'string' && d.match(/px$/)) { val += 'rem'; } return val; } })(window, window['lib'] || (window['lib'] = {})); //end flexible /*! * touchslide v1.1 * javascript触屏滑动特效插件,移动端滑动特效,触屏焦点图,触屏tab切换,触屏多图切换等 * 1.1 宽度自适应(修复安卓横屏时滑动范围不变的bug) */ var touchslide = function (a) { a = a || {}; var b = { slidecell: a.slidecell || "#touchslide", titcell: a.titcell || ".hd li", maincell: a.maincell || ".bd", effect: a.effect || "left", autoplay: a.autoplay || !1, delaytime: a.delaytime || 200, intertime: a.intertime || 2500, defaultindex: a.defaultindex || 0, titonclassname: a.titonclassname || "on", autopage: a.autopage || !1, prevcell: a.prevcell || ".prev", nextcell: a.nextcell || ".next", pagestatecell: a.pagestatecell || ".pagestate", pnloop: "undefined " == a.pnloop ? !0 : a.pnloop, startfun: a.startfun || null, endfun: a.endfun || null, switchload: a.switchload || null }, c = document.getelementbyid(b.slidecell.replace("#", "")); if (!c) return !1; var d = function (a, b) { a = a.split(" "); var c = []; b = b || document; var d = [b]; for (var e in a) 0 != a[e].length && c.push(a[e]); for (var e in c) { if (0 == d.length) return !1; var f = []; for (var g in d) if ("#" == c[e][0]) f.push(document.getelementbyid(c[e].replace("#", ""))); else if ("." == c[e][0]) for (var h = d[g].getelementsbytagname("*"), i = 0; i < h.length; i++) { var j = h[i].classname; j && -1 != j.search(new regexp("\\b" + c[e].replace(".", "") + "\\b")) && f.push(h[i]) } else for (var h = d[g].getelementsbytagname(c[e]), i = 0; i < h.length; i++) f.push(h[i]); d = f } return 0 == d.length || d[0] == b ? !1 : d }, e = function (a, b) { var c = document.createelement("div"); c.innerhtml = b, c = c.children[0]; var d = a.clonenode(!0); return c.appendchild(d), a.parentnode.replacechild(c, a), m = d, c }, g = function (a, b) { !a || !b || a.classname && -1 != a.classname.search(new regexp("\\b" + b + "\\b")) || (a.classname += (a.classname ? " " : "") + b) }, h = function (a, b) { !a || !b || a.classname && -1 == a.classname.search(new regexp("\\b" + b + "\\b")) || (a.classname = a.classname.replace(new regexp("\\s*\\b" + b + "\\b", "g"), "")) }, i = b.effect, j = d(b.prevcell, c)[0], k = d(b.nextcell, c)[0], l = d(b.pagestatecell)[0], m = d(b.maincell, c)[0]; if (!m) return !1; var n, o, n = m.children.length, o = d(b.titcell, c), p = o ? o.length : n, q = b.switchload, r = parseint(b.defaultindex), s = parseint(b.delaytime), t = parseint(b.intertime), u = "false" == b.autoplay || 0 == b.autoplay ? !1 : !0, v = "false" == b.autopage || 0 == b.autopage ? !1 : !0, w = "false" == b.pnloop || 0 == b.pnloop ? !1 : !0, x = r, y = null, z = null, a = null, b = 0, c = 0, d = 0, e = 0, g = /hp-tablet/gi.test(navigator.appversion), h = "ontouchstart" in window && !g, i = h ? "touchstart" : "mousedown", j = h ? "touchmove" : "", k = h ? "touchend" : "mouseup", m = m.parentnode.clientwidth, p = n; if (0 == p && (p = n), v) { p = n, o = o[0], o.innerhtml = ""; var q = ""; // if (1 == b.autopage || "true" == b.autopage) for (var r = 0; p > r; r++) q += "