/*-----------------------------------------------------------*/ /*copyright by 动力无限 www.btoe.cn*/ /*邮箱 btoe@btoe.cn*/ /*合作电话 400-0599-360*/ /*版权所有违者必究*/ /*index_style_lq v1.1.1 /*-----------------------------------------------------------*/ // new wow().init(); /*--menu--*/ $(function () { $(window).scroll(function () { if ($(window).scrolltop() >= 1) { $(".nav_xiala_xx").addclass("fixednav"); } else { $(".nav_xiala_xx").removeclass("fixednav"); } }); }); // banner jquery(".fullslide").slide({titcell:".hd ul",maincell:".bd ul",autopage:true,effect:"fold",autoplay:true,vis: 1,scroll: 1, delaytime:300,prevcell: ".prev", nextcell: ".next" }); // souk--txt $(function () { var souktxt = $('.soukname').attr('placeholder'); function input_sou(sou_dom, sou_txt) { $(sou_dom).blur(function() { $(this).parent().removeclass('focus'); $(this).attr('placeholder', sou_txt); }); } input_sou('.soukname', souktxt); $('.swap_value').focus(function() { $(this).parent().addclass('focus'); $(this).attr('placeholder', ''); }); }); // 品牌 jquery(".in2_pingpai_5").slide({ titcell:"#tab_pin li", maincell:".in2_pingpai_rr dl",delaytime:0,triggertime:0 }); // youshi jquery(".youshi_pro").slide({ titcell:"#tab_2 li", maincell:".tab_box_2",delaytime:0,triggertime:0 }); // 设计团队 jquery(".game163").slide({ titcell:".smallimg li", maincell:".bigimg", effect:"fold", autoplay:true,delaytime:200, startfun:function(i,p){ if(i==0){ jquery(".game163 .sprev").click() } else if( i%4==0 ){ jquery(".game163 .snext").click()} } }); jquery(".game163 .smallscroll").slide({ maincell:"ul",delaytime:500,vis:4,scroll:1,effect:"left",autopage:true,prevcell:".sprev",nextcell:".snext",pnloop:false }); // 见证 $(function () { $(".advantage_box").slide({maincell: ".in2_advantage_box dl", effect: "fade", autoplay: true, vis: 2, scroll: 1, delaytime:300, prevcell: ".prev_a", nextcell: ".next_a" }); }); jquery(".news").slide({ titcell: ".newstab li" , maincell:".newstabs .tabslist", effect:"left", }); //提交 $(function () { var placetxt1 = $('.username').attr('placeholder'), placetxt2 = $('.usertel').attr('placeholder'), placetxt3 = $('.useremail').attr('placeholder'), placetxt5 = $('.codetext').attr('placeholder'), placetxt4 = $('.xqcontent').attr('placeholder'); function inputblur(inputdom, placetxt) { $(inputdom).blur(function() { $(this).parent().removeclass('focus'); $(this).attr('placeholder', placetxt); }); } inputblur('.username', placetxt1); inputblur('.usertel', placetxt2); inputblur('.useremail', placetxt3); inputblur('.codetext', placetxt5); inputblur('.xqcontent', placetxt4); $('.inputmess').focus(function() { $(this).parent().addclass('focus'); $(this).attr('placeholder', ''); }); $('.submit-btn').on('click', function () { var kcontent = $('.xqcontent').val(); var kuser = $('.username').val(); var kphone = $('.usertel').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 == "") { alert('姓名不能为空!') $(".username").focus(); return false; } if (kphone == "") { alert('号码不能为空!') $(".usertel").focus(); return false; } if(!reg.test(kphone)) { alert('号码填写有误!') $(".usertel").focus(); return false; } if (kcontent == "" || kcontent.length < 10) { alert('留言内容必须大于10字!') $(".xqcontent").focus(); return false; } if (kcode == "") { alert('验证码不能为空') $(".codetext").focus(); return false; } $.post('/api/message.ashx?action=add', { "kcontent": '信息:' + kcontent, "kuser": kuser, "kphone": kphone, "kcode": kcode }, function (res) { if (res == '1') { alert("留言提交成功"); $('.xqcontent').val(''); $('.username').val(''); $('.usertel').val(''); $('.codetext').val(''); }else { alert("留言提交失败") } }) }) }) //点击验证码刷新 $("#imgcode").click(function () { $(this)[0].src = '/api/message.ashx?action=code&' + math.random() });