/*--导航menu--*/ /* $(function () { $(window).scroll(function () { if ($(window).scrollTop() >= 1) { $(".nav_xiala_aa").addClass("fixedNav"); } else { $(".nav_xiala_aa").removeClass("fixedNav"); } }); }); */ /*! * 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() } }) }) /* 搜索 */ $('.lh-search-btn').click(function(){ if($('body').hasClass('Search')){ $('body').removeClass('Search'); }else{ $('body').addClass('Search'); } }); $('.buttons').on('click', function () { var keywords = $('#keywords').val(); if (keywords == "") { alert('关键字不能为空!') $("#keywords").focus(); return false; }else{ window.open('/search_' + 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') }) }) // 表单提交 $('#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() }) //鼠标跟随样式 $(function () { var cursor = '
' $('body').append(cursor) $(document).on('mousemove', function (e) { $('.follower').css({ left: e.clientX, top: e.clientY }); }); $(document).on("mouseenter", "a", function () { $('.follower span').css({ 'width': '10px', 'height': '10px', 'top': '0px', 'left': '0px', 'transition': '.5s' }) }); $(document).on("mouseleave", "a", function () { $('.follower span').css({ 'width': '20px', 'height': '20px', 'top': '-10px', 'left': '-10px', 'transition': '.5s' }) }); if(window.innerWidth < 1200){ $('#c_public_htmlCode-15542567538626617').hide(); } }) // end