$(document).ready(function(){ index(); }) $(window).load(function(){ var banner_doth=$('.banner_dot').outerheight(true); $('.banner_dot').css({'margin-top':-banner_doth/2+'px'}) resizes(); // scrolltops(); }) function index(){ $('.menu').on('click',function(){ $('.slide_nav').addclass('left_active') $('.all_contents,.all_content').addclass('active'); $('.fixed_bg').show(); $('.header .logo').animate({'opacity':0}) }) $('.fixed_bg,.phone_back').on('click',function(){ $('.slide_nav').removeclass('left_active') $('.all_contents').removeclass('active'); settimeout(function(){ $('.all_content').removeclass('active'); },400) $('.fixed_bg').hide(); $('.header .logo').animate({'opacity':1}) }) $('.slide_nav .slide_nav_ul li a').hover(function(){ $(this).find('.slide_nav_bg span').stop(true,true); $(this).find('.slide_nav_bg span').animate({'width':'100%'},400) },function(){ $(this).find('.slide_nav_bg span').animate({'width':'0%'},400) }) } function resizes(){ winh=$(window).height(); winw=$(window).width(); $('.banner,.banner a,.banner li').height(winh); var banner_doth=$('.banner_dot').outerheight(true); $('.banner_dot').css({'margin-top':-banner_doth/2+'px'}) } //鎵嬫満寮圭獥 var w, h, classname; function getsrceenwh() { w = $(window).width(); h = $(window).height(); $('#dialogbg').width(w).height(h); } window.onresize = function () { getsrceenwh(); } $(window).resize(); $(function () { getsrceenwh(); //鏄剧ず寮规 $('.search a').click(function () { classname = $(this).attr('class'); $('#dialogbg').fadein(300); $('#dialog').removeattr('class').addclass('animated ' + classname + '').fadein(); }); //鍏抽棴寮圭獥 $('.clasedialogbtn').click(function () { $('#dialogbg').fadeout(300, function () { $('#dialog').addclass('bounceoutup').fadeout(); }); }); }); $(window).scroll(function(){ var $height=$(document).scrolltop(); // console.log($height) if($height>20){ $(".top").addclass('cd_fixed') } if($height<20){ $(".top").removeclass('cd_fixed') } }) $(".subnav").hover(function () { $(this).next(".tttt").show() }, function () { $(this).next(".tttt").hide() }) $(".tttt").hover(function () { $(this).show() $(".subnav").addclass("ts") }, function () { $(this).hide() $(".subnav").removeclass("ts") })