//屏蔽鼠标右键 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(){ var DEFAULT_VERSION = "8.0"; var ua = navigator.userAgent.toLowerCase(); var isIE = ua.indexOf("msie")>-1; var safariVersion; if(isIE){ safariVersion = ua.match(/msie ([\d.]+)/)[1]; if(safariVersion <= DEFAULT_VERSION ){ $("body").append("
您当前使用的IE浏览器版本过低,为了您的浏览体验,建议您升级到 IE9+ 或者使用 firefox , chrome 最新版本!X
"); } } }) //在线留言 $(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(""); } }); }); }) $(function(){ $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.9) { _this.addClass('animate'); } }); $(window).scroll(function() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.9) { _this.addClass('animate'); // $(_this) // startScramble('.i-img-list.animate .home-dec'); // startScramble('.i-lista.animate .home-dec'); } }); }); });