$(function () { (function () { // $(".index-nav .nav li").addClass("hvr-underline-from-center") // $(".index-product a").addClass("hvr-reveal") // $(".indexServices .more").addClass("hvr-Grow") $(".header .header-nav .nav .nav-list .nav-item").each(function (i) { $(this).mouseenter(function () { $(this).find('.drop').stop().slideDown() }) $(this).mouseleave(function () { $(this).find('.drop').stop().slideUp() }) }) })(); (function () { $(".index-news .right .index-news-list-item a").each(function(i){ $(".index-news .right .index-news-list-item a").first().find('.desc').show() $(".index-news .right .index-news-list-item a").first().addClass("active") $(this).mouseenter(function () { $(".index-news .left a").eq(i).show().siblings('.index-news .left a').hide() $(this).addClass("active").siblings().removeClass("active"); $(this).find('.desc').stop().show() $(this).siblings().find('.desc').hide() }) }) $(".aboutSc-right .nav ul li").each(function (i) { $(".aboutSc-right .nav ul li").first().addClass('active') $(this).mouseenter(function () { $(this).addClass("active").siblings().removeClass("active"); }) }) $(".index-news .right .index-news-nav .item").each(function (i) { $(".index-news .right .index-news-nav .item").first().addClass('active') $(this).mouseenter(function () { $(this).addClass("active").siblings().removeClass("active"); $(".index-news .right .index-news-list-item").eq(i).show().siblings('.index-news .right .index-news-list-item').hide() }) }) $(".index-product .index-product-nav ul li").each(function (i) { $(".index-product .index-product-nav ul li").first().addClass('active') $(this).click(function () { $(this).addClass("active").siblings().removeClass("active"); $(".index-product .index-product-list-item").eq(i).show().siblings('.index-product .index-product-list-item').hide() }) }) })(); (function () { $("button").on('click', function () { url = SCOPE.url; name = $("#name").val(); tel = $("#tel").val(); hzlx = $("#hzlx").val(); cont = $("#cont").val(); if (name == "" || tel == "" || cont == "") { layer.msg('必填项不能为空'); return false; } else if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(tel))) { layer.msg('请填写正确的手机号'); return false; } datas = { name, tel, hzlx, cont } // console.log(datas); $.ajax({ type: "post", url: url, data: { datas: datas }, dataType: "json", success: function (e) { // console.log(e); if (e == 1) { layer.msg('提交成功'); } else if (e == 2) { layer.msg('提交失败'); } else if (e == 3) { layer.msg('格式错误'); } } }) }) })() })