var _$ = [ 'easeOutQuad' ]; var a0 = { ac: function () { $.fn.ac = function (a) { var e = this; e.each(function (c) { e.eq(c).hover(function () { $(this).addClass(a) }, function () { $(this).removeClass(a) }) }); return e } }, Tips: { Show: function () { $.tips = function (a) { $.each(a, function (a, c) { var d, f = $(c); d = 'input#telephone' === c ? $('span.phone-tips1') : 'input#telephone2' === c ? $('span.phone-tips2') : $(c).siblings('strong.tips'); '' === f.val() ? d.show() : (d.hide()); f.blur(function () { '' === f.val() && d.show() }).focus(function () { d.hide(); $('#content').css('border', '1px solid #ddd') }); d.click(function () { f.focus() }) }) }; $.tips($('.ipt')) } }, iptNormal: function (id, times) { var obj = $('#' + id); obj.css('background-color', '#FFF'); if (times < 0) { return; } times = times - 1; setTimeout('a0.iptError(\'' + id + '\',' + times + ')', 150); }, iptError: function (id, times) { var obj = $('#' + id); obj.css('background-color', '#F6CECE'); times = times - 1; setTimeout('a0.iptNormal(\'' + id + '\',' + times + ')', 150); }, fedURL: function () { var a = $('#userNamea').val(), e = $('#userPhonea').val(), c = $('#userEmaila').val(), f = $('#contenta').val().trim(); var ast = true; if (f == '' || f == null) { $('#contenta').css('border', '1px solid #f00'); a0.iptError('contenta', '1'); ast = false; } /*var regphone = /[0-9]{11}/; var resphone = e.match(regphone); if(e.length!=11||resphone==null){ $("#phoneTip").css("display","block"); $('#userPhone').css('border','#f00 solid 1px'); a0.iptError('userPhone', '1'); ast = false; }else{ $("#phoneTip").css("display","none"); $('#userPhone').css('border','#f6f6f6 solid 1px'); } if(a.length>0){ $("#nameTip").css("display","none"); $('#userName').css('border','#f6f6f6 solid 1px'); }else{ $("#nameTip").css("display","block"); $('#userName').css('border','#f00 solid 1px'); a0.iptError('userName', '1'); ast = false; }*/ if(ast){ $.ajax({ type: 'post', url: a0.url.ajaxfed, data: { mailType: 'suggest', userName: a, userPhone: e, userEmail: c, content: f, token:guarant }, success: function () { $('.fankuiimg').show(); setTimeout(function () { $('.fankuiimg').hide() }, 2000); $('#userPhonea').val(''), $('#userEmaila').val(''), $('#contenta').val(''), $('#userNamea').val(''); } }); } /*else { var regphone = /[0-9]{11}/; var resphone = e.match(regphone); if(e.length!=11||resphone==null){ $("#phoneTip").css("display","block"); $('#userPhone').css('border','#f00 solid 1px'); a0.iptError('userPhone', '1'); }else{ $("#phoneTip").css("display","none"); $('#userPhone').css('border','#f6f6f6 solid 1px'); if(a.length>0){ $("#nameTip").css("display","none"); $('#userName').css('border','#f6f6f6 solid 1px'); $.ajax({ type: 'post', url: a0.url.ajaxfed, data: { mailType: 'suggest', userName: a, userPhone: e, userEmail: c, content: f }, success: function () { $('.fankuiimg').show(); setTimeout(function () { $('.fankuiimg').hide() }, 2000); $('#userPhone').val(''), $('#userEmail').val(''), $('#content').val(''), $('#userName').val(''); } }); }else{ $("#nameTip").css("display","block"); $('#userName').css('border','#f00 solid 1px'); a0.iptError('userName', '1'); } } }*/ }, BackTop: { gotoTop: function () { var a = ''; var e = ''; var c = ''; a0.Tips.Show(); a0.ac(); $('.r-f-d').hover(function () { $(this).stop().animate({ right: 0 }) }, function () { $(this).stop().animate({ right: - 42 }) }); $('.v-n-e .j').hover(function () { $(this).stop().animate({ marginTop: - 10 }) }, function () { $(this).stop().animate({ marginTop: 0 }) }); $('.backToTop .a').hover(function () { $(this).find('.b').stop().fadeTo(0, 0).animate({ opacity: 1, right: 32 }, 350, function () { $(this).show() }) }, function () { $(this).find('.b').stop().animate({ opacity: 0, right: 120 }, 250, function () { $(this).hide() }) }, 1000); $('.backToTop .l').click(function () { $('.backToTop').stop().animate({ opacity: 0, left: 'auto', right: 0 }, 250, function () { $('.r-f-d').show(); $('.backToTop').hide() }); }); $('.r-f-d').click(function () { if ($(window).width() < $('.header').outerWidth() + 90) { $('.backToTop').stop().animate({ opacity: 1, left: 'auto', right: 0 }, 250, function () { $('.r-f-d').hide(); $('.backToTop').show() }); } else { $('.backToTop').stop().animate({ opacity: 1, left: $('.header').offset().left + $('.header').outerWidth() + 25 }, 250, function () { $('.r-f-d').hide(); $('.backToTop').show() }); } }) $('.backToTop .t').click(function () { $('html, body').animate({ scrollTop: 0 }, 600) }); /* $('.backToTop .a').ac('on'); b = '.backToTop'; h = '.header'; $(b).css('left', $(h).offset().left + 25 + $(h).outerWidth()).show(); $btf = function () { var a = $(document).scrollTop(); $(window).height(); $(window).width() < $('.header').outerWidth() + 140 && $(b).css('left', ''); $(b).css('left', $(h).offset().left + $(h).outerWidth() + 25); window.XMLHttpRequest || $(b).css('top', a + 300); $(window).width() < $('.header').outerWidth() + 140 && $(b).css('left', '') }; $(window).bind('scroll', $btf); $(window).resize($btf)*/ } } }; a0.BackTop.gotoTop(); //a0.url.about = basePath1 + 'gotoAboutAs.html'; //关于我们