$(document).ready(function(){ /*动画*/ wow = new wow({   animateclass: 'animated', }); wow.init(); $('#mycarousel').carousel('cycle'); }) $(function(){ //汉堡导航更换 $('.nav__trigger').on('click', function(e){ var scrolldistance = window.pageyoffset || document.documentelement.scrolltop || document.body.scrolltop; if (scrolldistance >= 50) { // 触发的位置 e.preventdefault(); $(".iphone__screen").toggleclass('nav--active'); if($(".iphone__screen").hasclass("nav--active")){ $(".iphone_head-r").hide(); $(".nav_icon").attr("src","images/nav_close.png"); }else{ $(".iphone_head-r").show(); $(".nav_icon").attr("src","images/nav_cion_b.png"); } }else{ e.preventdefault(); $(".iphone__screen").toggleclass('nav--active'); if($(".iphone__screen").hasclass("nav--active")){ $(".iphone_head-r").hide(); $(".nav_icon").attr("src","images/nav_close.png"); }else{ $(".nav_icon").attr("src","images/nav_cion.png"); } } }); //繁体简体更换 $('.iphone_lan').on('click', function(e){ $(this).addclass("active"); $(this).siblings().removeclass("active"); }) $('.head_languagebtn a').on('click', function(e){ $(this).addclass("active"); $(this).siblings().removeclass("active"); }) }) //导航固定 document.addeventlistener('scroll', function (event) { var scrolldistance = window.pageyoffset || document.documentelement.scrolltop || document.body.scrolltop; if (scrolldistance >= 50) { // 触发的位置 document.getelementsbyclassname('iphone__screen')[0].style.csstext = 'position:fixed;z-index:999'; $(".iphone_head-r").show(); $(".iphone__screen").css({"background":"#fff","box-shadow":"1px 1px 1px #eee"}); $(".nav_icon").attr("src","images/nav_cion_b.png"); //汉堡导航更换 if($(".iphone__screen").hasclass("nav--active")){ $(".nav_icon").attr("src","images/nav_close.png"); } } else { $(".iphone_head-r").hide() ; $(".nav_icon").attr("src","images/nav_cion.png"); $(".iphone__screen").css({"background":"transparent","box-shadow":"0px 0px 0px #eee"}); if($(".iphone__screen").hasclass("nav--active")){ $(".nav_icon").attr("src","images/nav_close.png"); } } }); $(function(){ var h1 =180; var h2 =180; ss = $(document).scrolltop(); $(window).scroll(function(){ s = $(document).scrolltop(); if(s< h1){ $('.headbox').removeclass('yya'); $('.headbox').css('top','0 !important'); }if(s > h1){ $('.headbox').addclass('yya'); }if(s > h2){ $('.headbox').addclass('gizle'); if(s > ss){ $('.headbox').removeclass('sabit'); }else{ $('.headbox').addclass('sabit'); } ss = s; } }); });