
/**
 * Created by Administrator on 2018/8/17.
 */

$(function(){
    /*导航手机点击*/
    $('.phone_menu_trigger').click(function(){
        $(this).toggleClass('on');
        var phone_menu=$('.phone_menu');
        slideupdown2(phone_menu);
    })
    /*手机端导航点击*/
    function slideupdown(obj){
        var visible=obj.is(':visible');
        if(visible){
            obj.prev().removeClass('open');
            obj.slideUp();
        }else{
            obj.prev().addClass('open');
            obj.slideDown().parent().siblings('li').find('ul').slideUp().prev().removeClass('open');
        }
    }
    function slideupdown2(obj){
        var $this=obj;
		if($this.is(':hidden')){
			$this.show();
			$('html,body').css({"overflow":"hidden","height":"100%"});
		}else{
			$this.hide();
			$('html,body').css({"overflow":"scroll","height":"auto"});
	    } 
    }
    $('.phone_menu>li').each(function(){
        $(this).click(function(){
            var dls=$(this).find('.phone_menu_tab');
            slideupdown(dls);
        })
    })

    /*返回顶部*/
    $('#back-ToTop').click(function() {
        $('html,body').animate({'scrollTop': 0}, 500);
    })
})