PageSourceSearch

https://www.mykq120.com/static/js/brand.js

js mykq120.com collected 2026-09-29 10:06:39 UTC 3,133 bytes, 78 lines download raw bytes

1// 品牌中心公共JS
2$(function () {
3    // 左侧导航漂浮
4    setLeftMenu();
5    // brandTools();
6
7    $(window).on('scroll', function () {
8        setLeftMenu();
9        // brandTools();
10    });
11
12    // $(window).on('resize', function () {
13    //     if ($(window).width() <= 1340) {
14    //         $('.brand-tool').fadeOut();
15    //     } else {
16    //         var toolPostion = parseInt(($(window).width() - 1340) / 2) + 'px';
17    //         $('.brand-tool').css('right', toolPostion).fadeIn();
18    //     }
19    // });
20
21    // 左侧菜单当前栏目高亮
22    var curTid = $('.brand-left-bd').data('tid');
23    if (typeof (curTid) != 'undefined') {
24        $('.brand-left-bd ul li').each(function () {
25            if ($(this).data('tid') == curTid) {
26                $(this).addClass('on');
27            }
28        });
29    }
30    $('.brand-left-bd ul li[data-tid="18"] a').attr('target', '_blank');
31
32    // 右侧漂浮工具
33    // var brandToolHtml =
34    //     '<div class="brand-tool">' +
35    //     '    <div class="brand-tool-links">' +
36    //     '        <a class="brand-tool-home" href="/"><i></i><span>首页</span></a>' +
37    //     '        <a class="brand-tool-youhui" href="/swt/" onclick="openChat();return false;"><i></i><span>优惠</span></a>' +
38    //     '        <a class="brand-tool-chat" href="/swt/" onclick="openChat();return false;"><i></i><span>客服</span></a>' +
39    //     '        <a class="brand-tool-yuyue" href="/swt/" onclick="openChat();return false;"><i></i><span>预约</span></a>' +
40    //     '    </div>' +
41    //     '    <a class="brand-tool-top" href="javascript:;" target="_self" onclick="goTop();"><span>返回<br>顶部</span><i></i></a>' +
42    //     '</div>';
43    // $('body').append(brandToolHtml);
44    // var toolPostion = parseInt(($(window).width() - 1340) / 2) + 'px';
45    // $('.brand-tool').css('right', toolPostion).fadeIn();
46});
47
48// function brandTools() {
49
50//     if ($(window).scrollTop() + $(window).height() < $('.public-footer').offset().top) {
51//         $('.brand-tool').removeClass('brand-tool-absolute').css('top', 'auto');
52//     } else if ($(window).scrollTop() + $(window).height() >= $('.public-footer').offset().top) {
53//         var top = $('.public-footer').offset().top - 50 - $('.brand-tool').outerHeight() + 'px';
54//         $('.brand-tool').addClass('brand-tool-absolute').css('top', top);
55//     } else {
56//         $('.brand-tool').removeClass('brand-tool-absolute').css('top', 'auto');
57//     }
58// }
59
60// function goTop() {
61//     $('html,body').animate({
62//         'scrollTop': 0
63//     }, 200);
64// }
65
66function setLeftMenu() {
67    var
68        bleftHeight = $('.brand-left').outerHeight(),
69        footTop = $('.public-address').offset().top,
70        winTop = $(window).scrollTop();
71    if (winTop + bleftHeight >= footTop) {
72        $('.brand-left').css({'position': 'absolute', 'top': footTop - bleftHeight + 'px'});
73    } else if (winTop > $('.brand-main').offset().top - 180) {
74        $('.brand-left').css({'position': 'fixed', 'top': '180px'});
75    } else {
76        $('.brand-left').css({'position': 'relative', 'top': 'auto'});
77    }
78}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.