hlzyWeb/Admin/Shop/Public/modulesJs/scroll.js

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

(function () {
    function fixedbarposition() {
        var containeroffsetleft = $('.content-right').offset().left;
        var containerouterWidth = $('.content-right').outerWidth(true);
        var containerouterTop = $('.content-right').offset().top;
        var left = parseInt(containeroffsetleft) + parseInt(containerouterWidth) + 10;
        var Ulheight = $('.fixedBar').children('ul').outerHeight(true);
        $('.fixedBar').css({ 'left': left, 'height': Ulheight, 'top': containerouterTop, 'margin-top': '0' });
    }
    fixedbarposition();
    $(window).resize(function (event) {
        fixedbarposition();
    });
    $('.fixedBar>ul>li').hover(function () {
        $(this).addClass('hover');
    }, function () {
        $(this).removeClass('hover');
    });
    $('.fixedBar>ul>li').click(function (event) {
        $(this).addClass('cur').siblings('li').removeClass('cur');
    });
    //初始化高亮
    $('.fixedBar>ul>li').eq(0).addClass('cur');
    // 获取相关数据
    var len = $('.fixedBar>ul').children('li').length;
    if (len == 0) {
        $('.fixedBar').hide();
    } else {
        var obj = $('.left-menu'),
            data = {};
        data.array_id = [];
        data.array_height = [];
        obj.each(function (index, el) {
            var me = $(this);
            var spanChild = $(this).children('dt').children('span');
            var id = spanChild.data('id'),
                offsetTop = me.offset().top,
                height = me.outerHeight(true);
            var Top = parseInt(offsetTop) + parseInt(height);

            data.array_id.push(id);
            data.array_height.push(Top);
        });
       
        for (var i = 0; i < data.array_height.length; i++) {
            var item = data.array_height[i];
            $(window).scroll(function () {
                var scrollTop = $(window).scrollTop();
                if (i == 0) {

                }
            })
        };
        // 滚动事件
        $(window).scroll(function (event) {
            var scrollTop = $(window).scrollTop();
            for (var i = 0; i < data.array_height.length; i++) {
                var item = data.array_height[i];
                if (i == 0) {
                    if (scrollTop < item) {
后面还有 29 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。