$(window).resize(function () { var fHeight = $("footer").outerHeight(); $(".wrap").css({ marginBottom: fHeight }); }); $(function () { var fHeight = $("footer").outerHeight(); $(".wrap").css({ marginBottom: fHeight }); $("select").change(function () { $(this).css("color", "#000"); }); }) $(".indutry>div").each(function () { $(this).live("mouseenter", function () { TweenMax.to($(this).find(".title"), 0.5, { top: '15%', ease: Quart.easeOut, delay: 0 }); TweenMax.to($(this).find("ul"), 1, { top: '35%', ease: Quart.easeOut, delay: 0 }); }).live("mouseleave", function () { TweenMax.to($(this).find(".title"), 0.5, { top: '80%', ease: Quart.easeOut, delay: 0 }); TweenMax.to($(this).find("ul"), 1, { top: '100%', ease: Quart.easeOut, delay: 0 }); }); }); $(".service li").each(function () { $(this).live("mouseenter", function () { TweenMax.to($(this).find(".num"), 0.5, { top: '-3rem', ease: Quart.easeOut, delay: 0 }); TweenMax.to($(this).find(".service-content"), 1, { top: '20%', ease: Quart.easeOut, delay: 0 }); }).live("mouseleave", function () { TweenMax.to($(this).find(".num"), 0.5, { top: '15%', ease: Quart.easeOut, delay: 0 }); TweenMax.to($(this).find(".service-content"), 1, { top: '40%', ease: Quart.easeOut, delay: 0 }); }); }); $(".submit").click(function () { var name = $("#name").val(); var place = $("#place").val(); var age = $("#age").val(); var id = $("#id").val(); var sex = $("#sex").val(); var work = $("#work").val(); var area = $("#area").val(); var budget = $("#budget").val(); var shopAddress = $("#shopAddress").val(); var experience = $("#experience").val(); var reason = $("#reason").val(); var mobile = $("#mobile").val().trim(); var code = $("#code").val(); var email = $("#email").val(); var address = $("#address").val(); if (name.length < 1) { alert("请填写姓名"); return; }; if (mobile.length < 1) { alert("请填写手机"); return; } if (code.length < 1) { alert("请填写验证码"); return; } var myreg = /^1[3|4|5|6|7|8|9]\d{9}$/; if (!myreg.test(mobile)) { alert("请输入有效的手机号码"); return; } if (area.length < 1) { alert("请输入您的申请地区"); return; } var coomodel = {}; coomodel.xingm = name; coomodel.xingb = sex == 0 ? false : true; coomodel.nianl = age; coomodel.shenfz = id; coomodel.diz = address; coomodel.jig = place; coomodel.muqzyyw = work; coomodel.shenqdq = area; coomodel.kaiddz = shopAddress; coomodel.touzys = budget; coomodel.chahyjy = experience == 0 ? false : true; coomodel.shenqly = reason; coomodel.shouj = mobile; coomodel.dianzyx = email; coomodel.code = code; coomodel.lianxdz = address; $.ajax({ url: "/serviceajax/apply", data: coomodel, dataType: "json", type: "post", success: function (data) { if (data.Success) { alert("提交成功"); location.reload(); } else { alert(data.Message) } }, error: function (e) { console.log(e) alert("系统繁忙,请稍后重试哦~"); } }); }) var wait = 60; function Jtime(o) { if (wait === 0) { o.off('click', sendCode).on('click', sendCode); o.html("获取验证码"); wait = 60; } else { o.html("" + wait + "s后"); wait--; setTimeout(function () { Jtime(o); }, 1000); } } $('.getcode').off('click', sendCode).on('click', sendCode); function sendCode() { var phone = $.trim($("#mobile").val()); if (phone.length <= 0) { alert("请输入手机号码哦~"); return; } if (/^(0?1[3456789]\d{9})$|^((0(10|2[1-3]|[3-9]\d{2}))?[1-9]\d{6,7})$/.test(phone)) { var btnMe = $('.getcode'); btnMe.off('click', sendCode); Jtime(btnMe); $.ajax({ url: '/Site/SendCode?r=' + Math.random(), type: 'post', data: { phone: phone }, dataType: 'json', success: function (data) { if (data.Success) { } else { alert(data.Message); } } }); } else { alert('请输入正确的手机号哦~'); } }; mySwiper = new Swiper('.product-wrap .swiper-container', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, grabCursor: true, loop: true, loopedSlides: 5, autoplay: { delay: 5000, disableOnInteraction: false, }, on: { progress: function (progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = slideProgress * modify * 28 + '%'; scale = 1 - Math.abs(slideProgress) / 5; zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); slide.transform('translateX(' + translate + ') scale(' + scale + ')'); slide.css('zIndex', zIndex); slide.css('opacity', 1); if (Math.abs(slideProgress) > 3) { slide.css('opacity', 0); } } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }) mySwiper.el.onmouseover = function () { mySwiper.autoplay.stop(); } //鼠标离开开始自动切换 mySwiper.el.onmouseout = function () { mySwiper.autoplay.start(); } var swiper = new Swiper('.competition .swiper-container', { speed: 1000, loop: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' } }); $(".store div").click(function () { $(this).addClass("active").siblings().removeClass("active"); var index = $(this).index(".store div"); $(".competition-show .swiper-container").eq(index).addClass("swiper-active").siblings().removeClass("swiper-active") var swiper = new Swiper('.competition .swiper-container', { speed: 1000, loop: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' } }); })