$(function () {
   
    // 页面过短避免底部留白
  
        var contheight= $(window).height();
        $('.flowcont').css('min-height',contheight-300)
        $('.bgFFF').css('min-height',contheight-220)
        console.log(contheight)
    // 选项卡切换
    $("#myTab li").click(function (e) {
        $(this).addClass('active').siblings().removeClass('active');
    });
    $("#myTab a").click(function (e) {
        e.preventDefault();
        $(this).tab("show");
    });
    $('nav a').on('click', function () {
        if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
            var target = $(this.hash);
            target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
            if (target.length) {
                $('html, body').animate({
                    scrollTop: target.offset().top - 50
                }, 1000);
                return false;
            }
        }
    });



    /// back to top
    var bTtop = $(".back_to_top");
    $(window).on('scroll', function () {
        var baktop = $(window).scrollTop();

        if (baktop > 200) {
            bTtop.fadeIn(1000);

        }
        else {
            bTtop.fadeOut(500);
        }

    });

    bTtop.on('click', function () {
        $('html, body').animate({
            scrollTop: 0,
        }, 2000)

    });

    // stciky menu
    var nav = $(".navbar");
    $(window).scroll(function () {

        var fixmenu = $(this).scrollTop();

        if (fixmenu > 185) {
            nav.addClass("menu_fix");
        }
        else {
            nav.removeClass("menu_fix");
        }

    });



});
