// language $(document).ready(function() { $("#dropdownmenu1 a").click(function() { $(".language-btn .dropdown-menu").slidetoggle(); // $(".language-btn i").removeclass("icon-fold").addclass("icon-zhankai") }) }); // 导航 $(".menu_open").click(function() { $(".right-cont").animate({ 'left': '0' }, 400); $(".hcover").animate({ 'right': '0' }, 400); }); $(".hcover").click(function() { $(this).animate({ 'right': '-100%' }, 400); $(".right-cont").animate({ 'left': '-100%' }, 400); $('.nav_item_open').css('left', '-100%'); }); $(".nav-item i").click(function() { /* $(".right-cont").animate({ 'left': '-100%' }, 400); */ $(this).next('.nav_item_open').css('left', '0'); }); $(".subopen").click(function() { $(this).parent('.nav_item_open').css('left', '-100%'); $(this).parent('.nav_item2_open').css('left', '-100%'); let nav= $(this).parent('.nav_item2_open').parent().parent('.nav_item_open') console.log('111111111112222',nav.length) if(nav.length>0){ $(this).parent('.nav_item2_open').parent().parent('.nav_item_open').animate({ 'left': '0' }, 400); } // $(".right-cont").animate({ // 'left': '0' // }, 400); }); $(".nav_item2 i").click(function() { $(this).next('.nav_item2_open').css('left', '0'); }); $(".subopenopen").click(function() { $(this).parent('.nav_item2_open').css('left', '-100%'); }); // 返回顶部 $(window).scroll(function() { if ($(window).scrolltop() >= 100) { $('.actgotop').fadein(300); $(".header_head").addclass("fixed-box"); } else { $('.actgotop').fadeout(300); $(".header_head").removeclass("fixed-box"); } }); $('.actgotop').click(function() { $('html,body').animate({ scrolltop: '0px' }, 800); }); // 左侧导航 $(".menutitle").click(function() { $(this).next("div").slidetoggle("slow") .siblings(".menucontent:visible").slideup("slow"); $(this).toggleclass("activetitle"); $(this).siblings(".activetitle").removeclass("activetitle"); $(this).siblings(".activetitle").children().removeclass("activetitle"); }); $(".menucontent > ul > li").click(function() { $(this).next("div").slidetoggle("slow") .siblings(".menuthree:visible").slideup("slow"); $(this).toggleclass("activetitle"); $(this).siblings(".activetitle").removeclass("activetitle"); $(this).siblings(".activetitle").children().removeclass("activetitle"); }); // 动画加载 $(function() { scrollheader(); //页面header滚动 scroll(); //滚动条下拉页面加载文字动画 }) //页面header滚动 function scrollheader() { var menuid; window.winwidth = $(window).width(); window.winheight = $(window).height(); var menusub, _navli = $("nav li"); var _delaytop = 0; $(window).bind("scroll", function() { var _wtop = _winscroll = windowpos = $(window).scrolltop(), docheight = $(document).height(), windowheight = $(window).height(), completion = windowpos / (docheight - windowheight) * window.winheight; _delaytop = _wtop; }); } //滚动首页面加载文字动画 function scroll() { $(document).scroll(function() { $('.animated').each(function() { var imagepos = $(this).offset().top; var timedelay = $(this).attr('data-delay'); var timedelay2 = timedelay / 10 var topofwindow = $(window).scrolltop(); var windowheight = $(window).height(); var $anim = $(this).attr('data-animation'); if (imagepos <= ($(window).scrolltop() + $(window).height())) { $(this).delay(timedelay).queue(function() { $(this).addclass($anim).clearqueue(); }); } else { $(this).queue(function() { $(this).removeclass($anim).clearqueue(); }); } }); }) $('.animated').each(function() { var timedelay = $(this).attr('data-delay'); var $anim = $(this).attr('data-animation'); $(this).delay(timedelay).queue(function() { $(this).addclass($anim).clearqueue(); }); }); }