//灞忚斀榧犳爣鍙抽敭 var jsArgument = document.getElementsByTagName("script")[document.getElementsByTagName("script").length-1].src; //鑾峰彇浼犻€掔殑鍙傛暟 rightButton = jsArgument.substr(jsArgument.indexOf("rightButton=") + "rightButton=".length, 1); if (rightButton == "1"){ document.oncontextmenu = function(e){return false;} document.onselectstart = function(e){return false;} if (navigator.userAgent.indexOf("Firefox") > 0){ document.writeln(""); } } // 鎵嬫満绔欒嚜鍔ㄨ烦杞 mobilejump = jsArgument.substr(jsArgument.indexOf("mobilejump=") + "mobilejump=".length, 1); if (mobilejump == "1"){ var url = window.location.href; var domain = "http://"+document.domain; if(url.slice(url.lastIndexOf("/")+1)=="index.php"){ url = url.slice(0,url.lastIndexOf("/")+1); } var isAndroid = navigator.appVersion.toLowerCase().indexOf("android") >= 0, isIphone = navigator.appVersion.toLowerCase().indexOf("iphone") >= 0; if (isAndroid || isIphone){ window.location.href = domain +"/m"; }; } // 鍥炲埌椤堕儴 $(document).ready(function(){ $(window).scroll(function(){ var scrollH = $(window).scrollTop(); if(scrollH>300){ $(".back-to").fadeIn(); }else{ $(".back-to").fadeOut(); } }) $(".back-to").on('click',function(){ $('html,body').animate({'scrollTop':0},500); }); }) //璁剧疆瀛椾綋澶у皬 function setFontSize(size) { var obj = document.getElementById("contentSize"); if (obj) { obj.style.fontSize = size + "px"; } } //鍦ㄧ嚎鐣欒█ $(function(){ $("#form-panel-mes .btn-submit").click(function(){ var name = $('#name').val(); var phone = $('#phone').val(); var email = $('#email').val(); var content = $('#content').val(); var code = $('#code').val(); if(name==""){ layer.open({ type: 1, area: ['300px', '150px'], shadeClose: true, //鐐瑰嚮閬僵鍏抽棴 content: '\<\div style="padding:20px;font-size:13px;">璇疯緭鍏ユ偍鐨勫鍚嶏紒\<\/div>' }); return false; } if(!(/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(phone))){ layer.open({ type: 1, area: ['300px', '150px'], shadeClose: true, //鐐瑰嚮閬僵鍏抽棴 content: '\<\div style="padding:20px;font-size:13px;">璇疯緭鍏ユ纭殑鎵嬫満鍙风爜锛乗<\/div>' }); return false; } if(content==""){ layer.open({ type: 1, area: ['300px', '150px'], shadeClose: true, //鐐瑰嚮閬僵鍏抽棴 content: '\<\div style="padding:20px;font-size:13px;">璇疯緭鍏ョ暀瑷€鍐呭锛乗<\/div>' }); return false; } if(code==""){ layer.open({ type: 1, area: ['300px', '150px'], shadeClose: true, //鐐瑰嚮閬僵鍏抽棴 content: '\<\div style="padding:20px;font-size:13px;">璇疯緭鍏ラ獙璇佺爜锛乗<\/div>' }); return false; } $.ajax({ type:"POST", url:"formMes.php", data:"name="+name+"&phone="+phone+"&email="+email+"&content="+content+"&code="+code, //date:{"name":name,"phone":phone,"email":email,"content";content} cache:false, //涓嶇紦瀛樻椤甸潰 success:function(result){ layer.open({area: ['300px', '154px'],shadeClose: true,content: result}); $('.form-panel .text,.form-panel .textarea').val(""); } }); }); })