HEX
Server: nginx/1.22.0
System: Linux iZuf6jdxbygmf6cco977lcZ 5.10.84-10.4.al8.x86_64 #1 SMP Tue Apr 12 12:31:07 CST 2022 x86_64
User: root (0)
PHP: 7.4.29
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen
Upload Files
File: /data/wwwroot/wordpress/wp-content/themes/yantou/static/js/global.js
/*!
 * GlobalMethod JavaScript Library v1.0.1
 *
 * Includes jquery.js
 *
 * Date: 2018-12-19T19:00Z
 */

setNavLine($('.pcNav-c .h-nav1 > li.active'));

$('.pcNav').hover(function () {
    // $(this).addClass('active')
}, function () {
    // $(this).removeClass('active');
    $('.pcNav_2').removeClass('active');
});

$('.pcNav-c .h-nav1 > li').hover(function () {

    var i = $(this).index();

    setNavLine($(this));

    if(i != 0 && i != 2){
        showNav(i)
    }


},function () {
    
} );

$('.g_scroll').click(function () {
    var h = $('.banner').height() - 90;
    $("html, body").animate({scrollTop: h}, {duration: 500, easing: "swing"});
});

function showNav(i) {
    $('.pcNav_2').addClass('active');
    $('.pcNav_2 .g_w .pcNav_u1_2').eq(i).show().siblings().hide()
}

function setNavLine(item) {
    var w = item.width();
    var l = item[0].offsetLeft;
    $('.pcNav-c line').css({'width': w, 'left': l + 'px'})
}

$('.video_play').click(function () {
    var src = $(this).attr('data-url');
    videoPlay(src)
});

$('.video_after').click(function () {
    videoClose()
});

$('.video_close').click(function () {
    videoClose()
});

function videoPlay(src) {
    $('.video_view').fadeIn();
    $('.video_view video').attr('src', src);
    $('.video_view video')[0].play()
}

function videoClose() {
    $('.video_view').fadeOut();
    $('.video_view video').attr('src', '');
}


new WOW().init();

!function ($, fn) {
    (fn($))()
}(jQuery, function () {
    var version = "1.0.1",

        GMethod = function () {


        };

    GMethod.fn = GMethod.prototype = {

        constructor: GMethod,
        data: {
            topNum: 90
        },
        init: function () {
            this.bindDom();
            this.addEvent();
            this.wScroll();
            this.imgW();
            this.getWidth();
            this.navActive();
            this.queryHash()


        },

        bindDom: function () {
            this.$toTop = $('.toTop');
            this.$divLink = $(".divLink");
            this.navBtn = $('.nav-btn');
            this.$img = $('img');
            this.$alert_btn = $(".alert_btn");
            this.$alert_close = $(".alert_close");
            this.$alert = $(".alert_code");

        },

        addEvent: function () {
            var base = this;

            $('.n_float_l_open').click(function () {
                $('.n_float_l').addClass('active');
            });
            $('.n_float_l_close').click(function () {
                $('.n_float_l').removeClass('active');
            });

            $('.float_right li .btn').click(function () {
                $('.float_right').hide();

            });

            // 手机导航按钮
            this.navBtn.on('click', function () {
                $('.nav-table-cell').toggleClass('close');
                $('.mynav-ul').toggleClass('showNav');

            });
            //回到顶部
            this.$toTop.click(function () {
                base.toTop(0);
            });

            //锚点索引
            this.$divLink.click(function () {

                var m = $(this).attr('data');
                var t = $(m).offset().top - base.topNum;
                base.toTop(t);
            });

            this.$alert_btn.click(function () {
                base.$alert.show()
            });
            this.$alert_close.click(function () {

                base.$alert.hide()
            })
        },

        imgW: function () {
            this.$img.each(function () {
                var w = $(this).attr('width');
                var h = $(this).attr('height');
                if (w) {
                    $(this).css({'width': w + 'px', 'height': h + 'px', 'max-width': '100%'})
                }
            });
        },
        getWidth: function () {
            this.topNum = window.innerWidth > 1200 ? 90 : 60;
        },
        wScroll: function () {
            var base = this;
            $(window).scroll(function () {
                console.log(0)
                base.navActive()
            });

        },
        navActive:function(){
            var scroll_height = document.documentElement.scrollTop || document.body.scrollTop;

            if (scroll_height > 80) {
                $('.pcNav').addClass('active')
            } else {
                $('.pcNav').removeClass('active')
            }
        },
        toTop: function (t) {
            $("html, body").animate({scrollTop: t}, {duration: 500, easing: "swing"});
            return false;
        },
        queryHash:function(){
            var base = this;
            var hash =  window.location.hash;
            if(hash){
                var t = $(hash).offset().top - base.topNum;
                base.toTop(t);
            }else {
                $('.n_banner .g_scroll').click()
            }
        }


    };
    GMethod.prototype.init();
    return GMethod
});