var $window = $(window), ww = $window.width(), wh = $window.height(); $(function(){ /********手机菜单**********/ $('.buttonset').click(function(){ $('.neirong').toggleclass('neirong-show'); $(this).toggleclass('on'); }) // 案例动画效果 if($(window).width()>1024){ $(".case_list ul li .case_img").hover(function(){ $(this).parent().parent().siblings().find('.case_cover').stop().addclass('on'); $('.cover-row').stop().addclass('on'); // $(this).parent().parent().siblings().find('.cover-glass').stop().removeclass('on'); $(this).parent().parent().find('.cover-glass').stop().addclass('on'); },function(){ $(this).parent().parent().siblings().find('.case_cover').stop().removeclass('on'); $('.cover-row').stop().removeclass('on'); // $(this).parent().parent().siblings().find('.cover-glass').stop().addclass('on'); $(this).parent().parent().find('.cover-glass').stop().removeclass('on'); }); }; // 返回顶部 $('.m-totop').click(function(event) { $('body, html').animate({scrolltop:0}, 600); }); $('.back-top').click(function(event) { $('body, html').animate({scrolltop:0}, 600); }); // 显示qq信息 $("#qq_s").hover( function(){ $(".qq_y").hide(); $(".qq_x").show(); }, function(){ $(".qq_y").show(); $(".qq_x").hide(); } ) //案例底部form $(window).on('load resize',function(event) { if($(window).width()>1199){ var demandh = $('.demand_left').height(); $('.demand_right').height(demandh); } }); $(window).on('scroll resize',function(event) { if ($('.demand').length == 0) { return ; } var h=$('.demand').offset().top; if ($(this).scrolltop() > h - 500 && $(this).scrolltop() < h + 500) { $('.demand').addclass('cur'); }else{ $('.demand').removeclass('cur'); } }); //鼠标向上滚动出现菜单 scroll(function(x){ var scorolltop = $(document).scrolltop(); if(scorolltop < 100){ $('.navbar-fixed').stop().removeclass('show'); }else if(x == "up"){ $('.navbar-fixed').stop().addclass('show'); }else if(x == "down"){ $('.navbar-fixed').stop().removeclass('show'); } }) /*案例继续了解动画*/ function o() { r = !0, settimeout(function() { if (r) { r = !0; var o; e.addclass("det_more_hover"), a.show().stop().fadeto(800, .3), s.stop().animate({ top: -f, height: i, opacity: 1 }, { step: function(t, e) { o = e.pos, s.css({ filter: "alpha(opacity=" + parseint(1e4 * o) / 100 + ")" }) } }, n) } }, 100) } function t() { r = !1; var o; e.removeclass("det_more_hover"), a.stop().fadeout(800), s.stop().animate({ top: 0, height: p, opacity: 0 }, { step: function(t, e) { o = 1 - e.pos, s.css({ filter: "alpha(opacity=" + parseint(1e4 * o) / 100 + ")" }) } }, n) } var e = $(".det_more"), a = $(".det_more_mask"), s = e.find(".det_more_bg"), i = 330, p = 200, f = (i - p) / 2, n = 800, r = !1; s.css("top", 0), e.hover(o, t) /*案例继续了解动画结束*/ // .demand-logo控制 // $('.demand-logo-one-desc').height($('.demand-logo-one-img').height()); // 链接按钮点击效果.btn-circle-hover $('.btn-circle').click(function(e) { var parentoffset = $(this).offset(), relx = e.pagex - parentoffset.left, rely = e.pagey - parentoffset.top; var circler = $(this).outerwidth(true); $(this).find('.btn-circle-click').css({ top: rely, left: relx, width: 2.5*circler, height: 2.5*circler, opacity: 0, transition: 'width 1s, height 1s, opacity 1.2s' }); $(this).find('.btn-circle-click').get(0).addeventlistener('transitionend', zerocircleclick, false); function zerocircleclick(e) { if (e.propertyname == 'opacity') { $(this).css({ width: 0, height: 0, opacity: 1, transition: '0s' }); $(this).get(0).removeeventlistener('transitionend', zerocircleclick, false); } } }); // 链接按钮hover效果.btn-circle-hover $('.btn-circle').on('mouseenter mouseover', function (e) { var parentoffset = $(this).offset(), relx = e.pagex - parentoffset.left, rely = e.pagey - parentoffset.top; var circler = $(this).outerwidth(true); $(this).find('.btn-circle-hover').css({ top: rely, left: relx, width: 2.5*circler, height: 2.5*circler, opacity: 1, transition: 'width .8s, height .8s, opacity .8s' }); }).on('mouseout', function (e) { var parentoffset = $(this).offset(), relx = e.pagex - parentoffset.left, rely = e.pagey - parentoffset.top; $(this).find('.btn-circle-hover').css({ top: rely, left: relx, width: 0, height: 0, opacity: 0, transition: 'width .6s, height .6s, opacity 1.3s' }); }); // .demand_right出场优化 $('.demand_right').css('opacity', '1'); }); $(window).on('scroll', function(event) { divmove('.demand-logo-list'); }); // 页脚手机导航 $(window).on('resize ready', function(event) { // navclick(); }); function navclick() { var winw = $(window).width(); if (winw <= 992) { $('.footer-l > ul > li').click(function() { var _this = $(this); $('.footer-sub-menu').hide(); _this.find('.footer-sub-menu').show(); }); $('.footer-sub-menu').click(function(event) { event.stoppropagation(); }); } } // 动画效果 function divmove(sel, only) { winw = $(window).width(), winh = $(window).height(),//可视窗口高度 scrollt = $(window).scrolltop(),//鼠标滚动的距离 pu = $(window).width()/1920; $(sel).each(function(index, el) { var _this = $(this); if (_this.length && winh + scrollt - _this.offset().top > winh*(1/7) && scrollt < _this.height() + _this.offset().top) { if (_this.hasclass('letmove')) { _this.addclass('move'); } if (!only) { _this.find('.letmove').addclass('move'); } } }); } // 点击触发 function onceclick(sel) { winw = $(window).width(), winh = $(window).height(),//可视窗口高度 scrollt = $(window).scrolltop(),//鼠标滚动的距离 pu = $(window).width()/1920; $(sel).each(function(index, el) { var _this = $(this); if (_this.length && winh + scrollt - _this.offset().top > -winh*(3/4) && scrollt < _this.height() + _this.offset().top + winh*(1/10)) { if (!$(sel).hasclass('on') && !$(sel).siblings().hasclass('on')) { _this.click(); } } }); } function scroll( fn ) { var beforescrolltop = document.body.scrolltop, fn = fn || function() {}; window.addeventlistener("scroll", function() { var afterscrolltop = document.body.scrolltop, delta = afterscrolltop - beforescrolltop; if( delta === 0 ) return false; fn( delta > 0 ? "down" : "up" ); beforescrolltop = afterscrolltop; }, false); }