$(function () { //导航切换 (function () { jinq.autosize.setpxperrem(); window.onresize = function () { jinq.autosize.setpxperrem(); } $('.navbar-toggle').click(function () { $('.navbar').addclass('showmenu'); $('.showmenu>.overlay').click(function () { $('.showmenu').removeclass('showmenu'); $('.subnavli').removeclass('subnavli'); }); }); $('.navbar-nav>li').hover(function () { $('.subnavli').removeclass('subnavli'); $(this).find('.subnav').addclass('subnavli'); }); $('.wechat-box').click(function () { $('.code-box').fadein(); $('.code-box').click(function () { $('.code-box').fadeout(); }); }); $('.search-box').hover(function () { $('.item.search').addclass('on'); }, function () { $('.on').removeclass('on'); }) //products $('.list-btn').click(function () { $(this).next().slidetoggle(); }); (function () { $('ul.nav.navbar-nav.fl>li>a').click(function () { if (jinq.winwidth < 767 && $(this).next().hasclass('subnav-box')) { event.preventdefault(); } $('ul.nav.navbar-nav').find('.onli').click(function () { $('.subnav-box').stop().slideup(); $(this).addclass('off'); $(this).removeclass('onli'); }); $('ul.nav.navbar-nav').find('.off').click(function () { $(this).find('.subnav-box').stop().slidedown(); $(this).removeclass('off'); $(this).addclass('onli'); }); }); })() })(); //视频进入全屏 (function () { $('video').each(function () { var $this = $(this); $this[0].addeventlistener('click', function () { $this.attr({ 'controls': 'controls' }).addclass('video-fix'); $this.parent().addclass('video-fix').addclass('video-bg-show'); $this[0].play(); $this.parent().find('.close').show(); }); }); $('.close').click(function () { $(this).hide(); $(this).parent().find('video')[0].pause(); $(this).parent().find('video').removeattr('controls').removeclass('video-fix'); $(this).parent().find('video').parent().removeclass('video-fix').removeclass('video-bg-show'); }); })(); //选项卡切换 (function () { fntab($('.tab-nav'), $('.tab-items'), 'click'); function fntab(onav, acon, sevent) { var aelem = onav.children(); acon.hide().eq(0).show(); aelem.each(function (index) { $(this).on(sevent, function () { aelem.removeclass('active').addclass('gradient'); $(this).removeclass('gradient').addclass('active'); aelem.find('a').attr('class', 'triangle_down_gray'); $(this).find('a').attr('class', 'triangle_down_red'); acon.hide().eq(index).show(); console.log(index); $('.line').animate({ left: index * 86 }); }); }); } })(); // (function () { $('.afterfinish-nav').find('li').each(function () { $(this).click(function (e) { $(this).find('ul.afterfinish-sub-nav').slidetoggle(); $('ul.third-nav').slideup(); }) }); $('.sj').click(function () { event.stoppropagation(); $(this).find('.third-nav').slidetoggle(); }); })(); //wechat (function () { if (jinq.autosize.viewwidth() < 768) { $('.footer-right').click(function () { $(this).fadeout(); }); $('.wechat-con').click(function () { $('.footer-right').fadein(); }); } })() /*function isie() { //ie? if (!!window.activexobject || "activexobject" in window) return true; else return false; } if(isie()){ $('.section-top').hide(); }*/ var window_h = $(window).height(); //console.log("window_h:"+window_h); //console.log("fix_boxh:"+fix_boxh); //var margin_fix_box = (window_h - fix_boxh) / 2; //console.log("margin_fix_box:"+margin_fix_box); /*20180413秋月*/ var allwindoww = $(window).width(); if(allwindoww<=992) { $("header .subnav-box ").each(function () { console.log("运行了"); $(this).siblings("a").attr("href", "javascript:void(0);"); }); } /*end*/ });