/*--导航menu--*/ /* $(function () { $(window).scroll(function () { if ($(window).scrolltop() >= 1) { $(".nav_xiala_xx").addclass("fixednav"); } else { $(".nav_xiala_xx").removeclass("fixednav"); } }); }); */ /* 搜索 */ $('.lh-search-btn').click(function(){ if($('body').hasclass('search')){ $('body').removeclass('search'); }else{ $('body').addclass('search'); } }); /* 友情链接 */ $(".ft_click01").toggle(function(){ $(".list01").slidedown(); },function(){ $(".list01").slideup(); }); $('.buttons').on('click', function () { var keywords = $('#keywords').val(); if (keywords == "") { alert('关键字不能为空!') $("#keywords").focus(); return false; }else{ window.open(window.opener.location +'/seach' + keywords + 'html') } }) /* 询盘信息 */ $(function () { $('#xunpantext').hover(function() { var xunpantext = $(this).data('tiptitle'); $('#xunpantip').css({ top: $(this).outerheight(true) + 10 + 'px' }) $('#xunpantip').text(xunpantext) $('#xunpantip').addclass('xunpantextactive') }, function () { $('#xunpantip').removeclass('xunpantextactive') }) }) /*! * index_style_lq_menu v1.1.1 用于判断有三级菜单的时候,显示右侧小三角形 */ $(function () { $('.sanji_xiala_di').css('display',"none") $('.erji_xiala > i').each(function () { if($(this).find('.sanji_xiala').children().length>0){ $(this).find('.sanji_xiala_di').show() } }) }) // 表单提交 $('#btn').on('click', function () { var content = $('#content').val(); var username = $('#username').val(); var userphone = $('#userphone').val(); var kcode = $('#codetext').val().trim(); // var kemail = $('.useremail').val(); var reg = /^1[3|4|5|6|7|8|9]\d{9}$/; if (username == "") { alert('姓名不能为空!') $("#username").focus(); return false; } if (userphone == "") { alert('号码不能为空!') $("#userphone").focus(); return false; } if(!reg.test(userphone)) { alert('号码填写有误!') $("#userphone").focus(); return false; } if (content == "" || content.length < 10) { alert('留言内容必须大于10字!') $("#content").focus(); return false; } if (kcode == "") { alert('验证码不能为空') $("#codetext").focus(); return false; } $.post('/api/message.ashx?action=add', { "kcontent": '信息:' + content , "kuser": username, "kphone": userphone, "kcode": kcode }, function (res) { if (res == '1') { alert("留言提交成功"); $('#content').val(''); $('#username').val(''); $('#userphone').val(''); $('#codetext').val(''); }else { alert('留言提交失败') } }) }) //验证码刷新 $("#imgcode").click(function () { $(this)[0].src = '/api/message.ashx?action=code&' + math.random() })