/*-----------------------------------------------------------*/ /*copyright by 动力无限 www.btoe.cn*/ /*邮箱 btoe@btoe.cn*/ /*合作电话 400-0599-360*/ /*版权所有违者必究*/ /*-----------------------------------------------------------*/ jquery(".slidetxtbox").slide({effect:"fold"}); jquery(".slidebox").slide({maincell:".bd ul",autoplay:true,effect:"fold"}); jquery(".picscroll-left").slide({titcell:".hd ul",maincell:".quans ul",autopage:true,effect:"leftloop",autoplay:true,vis:4,prevcell:".prev1",nextcell:".next1"}); // 数字递增 (function($){$.fn.countto=function(opts){var options=$.extend({},$.fn.countto.defaults,opts);return $(this).each(function(){var _this=this,originaldata=$(this).text(),loops=math.ceil(options.speed/options.refreshinterval),increment=($(this).text()-options.from)/loops,loopcount=0,value=options.from,interval=setinterval(updatetimer,options.refreshinterval);function updatetimer(){value+=increment;loopcount++;var str=value.tofixed(options.decimals);this.sizenum=str.length;this.sizenumbefore=this.sizenum-options.decimals-1;if(this.sizenumbefore>=options.beforesize){$(_this).html(str+options.lastsymbol);}else{this._str=array(options.beforesize-this.sizenumbefore+1).join('0')+str;$(_this).html(this._str+options.lastsymbol);} if(typeof(options.onupdate)=='function'){options.onupdate.call(_this,value,loopcount);} if(loopcount>=loops){clearinterval(interval);$(_this).html(originaldata+options.lastsymbol);value=$(_this).text();if(typeof(options.oncomplete)=='function'){options.oncomplete(value,loopcount,_this);}}}});};$.fn.countto.defaults={lastsymbol:"%",from:0,speed:1000,refreshinterval:100,beforesize:0,decimals:0,onupdate:null,oncomplete:null};})(jquery); // 数字递增效果 var lock = true; $(window).scroll(function () { var windowtop = $(window).scrolltop(); var numrowtop = $('.listnum').offset().top - 800; if (windowtop >= numrowtop && lock) { $('.listnum li .shu').countto({ lastsymbol:"", //显示在最后的字符 from: 0, // 开始时的数字 speed: 3000, // 总时间 refreshinterval:100, // 刷新一次的时间 beforesize:0, //小数点前最小显示位数,不足的话用0代替 decimals: 0, // 小数点后的位数,小数做四舍五入 }) lock = false; } }) $(function () { $('#btn').on('click', function () { var kcontent = $('#contant').val(); var kuser = $('#name').val(); var kphone = $('#tel').val(); var kcode = $('#codetext').val().trim(); // var kemail = $('.useremail').val(); var reg = /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^((\(\d{3}\))|(\d{3}\-))?(1[3578]\d{9})$)|(^400[0-9]{7})/; if (kuser == "") { var txt= "姓名不能为空!"; var option = { title: "温馨提示:", btn: parseint("0011",2), onok: function(){ console.log("确认啦"); } } window.wxc.xcconfirm(txt, "custom", option); $("#name").focus(); return false; } if (kphone == "") { var txt= "号码不能为空!"; var option = { title: "温馨提示:", btn: parseint("0011",2), onok: function(){ console.log("确认啦"); } } window.wxc.xcconfirm(txt, "custom", option); $("#tel").focus(); return false; } if (!reg.test(kphone)) { var txt= "号码填写有误!"; var option = { title: "温馨提示:", btn: parseint("0011",2), onok: function(){ console.log("确认啦"); } } window.wxc.xcconfirm(txt, "custom", option); $("#tel").focus(); return false; } // if (kcontent == "" || kcontent.length < 10) { // var txt= "留言内容必须大于10字!"; // var option = { // title: "温馨提示:", // btn: parseint("0011",2), // onok: function(){ // console.log("确认啦"); // } // } // window.wxc.xcconfirm(txt, "custom", option); // $("#contant").focus(); // return false; // } if (kcode == "") { var txt= "验证码不能为空"; var option = { title: "温馨提示:", btn: parseint("0011",2), onok: function(){ console.log("确认啦"); } } window.wxc.xcconfirm(txt, "custom", option); $("#codetext").focus(); return false; } $.post('/api/message.ashx?action=add', { "kcontent": '信息 :' + kcontent, "kuser": kuser, "kphone": kphone, "kcode": kcode }, function (res) { if (res === 1) { var txt= "留言提交成功"; var option = { title: "温馨提示:", btn: parseint("0011",2), onok: function(){ console.log("确认啦"); } } window.wxc.xcconfirm(txt, "custom", option); $('#contant').val(''); $('#name').val(''); $('#tel').val(''); } else { var txt= "留言提交成功"; var option = { title: "温馨提示:", btn: parseint("0011",2), onok: function(){ console.log("确认啦"); } } window.wxc.xcconfirm(txt, "custom", option); } }) }) }) //验证码刷新 $("#imgcode").click(function () { $(this)[0].src = '/api/message.ashx?action=code&' + math.random() }); // alert (function($){ window.wxc = window.wxc || {}; window.wxc.xcconfirm = function(pophtml, type, options) { var btntype = window.wxc.xcconfirm.btnenum; var eventtype = window.wxc.xcconfirm.eventenum; var poptype = { custom: { title: "", icon: "", btn: btntype.ok } }; var itype = type ? type instanceof object ? type : poptype[type] || {} : {};//格式化输入的参数:弹窗类型 var config = $.extend(true, { //属性 title: "", //自定义的标题 icon: "", //图标 btn: btntype.ok, //按钮,默认单按钮 //事件 onok: $.noop,//点击确定的按钮回调 oncancel: $.noop,//点击取消的按钮回调 onclose: $.noop//弹窗关闭的回调,返回触发事件 }, itype, options); var $txt = $("
").html(pophtml);//弹窗文本dom
var $tt = $("").addclass("tt").text(config.title);//标题
var icon = config.icon;
var $icon = icon ? $("