PageSourceSearch

https://yonyou.com/static/js/header.min.js?v=7685cee4

js yonyou.com collected 2026-09-25 23:39:52 UTC 3,221 bytes, 122 lines download raw bytes

1$(function () {
2const toggleDropdown = (dom) => {
3if (dom.classList.contains('active')) {
4closeDropdown(dom);
5} else {
6openDropdown(dom);
7}
8};
9const openDropdown = (dom) => {
10dom.classList.add('active');
11};
12const closeDropdown = (dom) => {
13dom.classList.remove('active');
14};
15function initHeaderEvents() {
16var navMobile = document.getElementById('nav-mobile');
17var nav = document.getElementById('nav');
18var language = document.getElementById('language');
19if (!navMobile || !nav || !language) return;
20navMobile.addEventListener('click', () => {
21toggleDropdown(nav);
22closeDropdown(language);
23});
24nav.addEventListener('click', (e) => {
25if (window.innerWidth <= 850) {
26if (e.target.classList.contains('nav-item-title')) {
27var navItem = e.target.closest('.nav-item');
28if (navItem) {
29toggleDropdown(navItem);
30}
31}
32if (e.target.classList.contains('list-title')) {
33var listSecond = e.target.closest('.list-second');
34if (listSecond) {
35toggleDropdown(listSecond);
36}
37}
38}
39});
40language.addEventListener('click', (e) => {
41if (window.innerWidth <= 850) {
42toggleDropdown(language);
43closeDropdown(nav);
44}
45});
46}
47function initStickyFallback() {
48var headerEl = document.querySelector('.header');
49if (!headerEl) return;
50if (window.innerWidth <= 850) return;
51var STICKY_TOP = 35;
52var STICKY_FAIL_THRESHOLD = STICKY_TOP - 5;
53var RETURN_SCROLL_MAX = 50;
54var isFixedMode = false;
55function checkPosition() {
56if (!headerEl) return;
57if (!isFixedMode) {
58var rect = headerEl.getBoundingClientRect();
59if (rect.top < STICKY_FAIL_THRESHOLD) {
60document.body.classList.add('header-fixed-fallback');
61isFixedMode = true;
62}
63} else {
64var scrollY = window.pageYOffset || document.documentElement.scrollTop;
65if (scrollY <= RETURN_SCROLL_MAX) {
66document.body.classList.remove('header-fixed-fallback');
67isFixedMode = false;
68}
69}
70}
71var ticking = false;
72window.addEventListener('scroll', function () {
73if (!ticking) {
74requestAnimationFrame(function () {
75checkPosition();
76ticking = false;
77});
78ticking = true;
79}
80}, { passive: true });
81setInterval(checkPosition, 300);
82checkPosition();
83}
84initHeaderEvents();
85if (document.getElementsByClassName("header").length == 0) {
86$.ajax({
87type: "GET",
88url: "/assets/html/header.html",
89contentType: "text/html; charset=UTF-8",
90success: function (res) {
91$("body").prepend(res);
92var version26CssFiles = [
93'/assets/css/version26/main.css',
94'/assets/css/version26/base.css',
95'/assets/css/version26/header.css?v=20260831',
96'/assets/css/version26/footer.css',
97'/assets/css/version26/media.css'
98];
99version26CssFiles.forEach(function(cssFile) {
100if (document.querySelector('link[href="' + cssFile + '"]') === null) {
101var link = document.createElement('link');
102link.rel = 'stylesheet';
103link.href = cssFile;
104document.head.appendChild(link);
105}
106});
107initStickyFallback();
108if (typeof getYonyouUserInfo === "function") {
109getYonyouUserInfo();
110}
111initHeaderEvents();
112},
113});
114} else {
115initStickyFallback();
116}
117$(document).on('click', 'a[data-uba-click-key]', function(e) {
118if (window.yonyouLogger && typeof window.yonyouLogger.externalClick === 'function') {
119yonyouLogger.externalClick(e, $(this).attr('data-uba-click-key'));
120}
121});
122});

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.