PageSourceSearch

https://www.lin-shiao-tung.com/assets/cache/4283bb0c731f970c046161dbe2c509c6.js

js lin-shiao-tung.com collected 2026-09-29 20:37:46 UTC 4,685 bytes, 151 lines download raw bytes

1;
2(function () {
3  'use strict';
4
5  // Class className
6  function HeaderGroup() {
7    this.init();
8    
9  }
10
11  HeaderGroup.prototype.init = function () {
12    var _this = this;
13
14    _this.checkSubNevLevel();
15
16    ScrollTrigger.create({
17      id: 'scrt_header',
18      target: '#js-headerGroup',
19      start: 'top+=2 top',
20      endTrigger: '._footer',
21      end: 'bottom top',
22      pin: '#js-headerGroup ._headerGroup_wrap',
23      pinSpacing: false,
24      onEnter: () => {
25        $('#js-headerGroup').addClass('_headerGroup--pin');
26      },
27      onLeaveBack: () => {
28        $('#js-headerGroup').removeClass('_headerGroup--pin');
29      }
30    });
31
32    ScrollTrigger.create({
33      id: 'scrt_headerRoom',
34      trigger: '#js-headerGroup',
35      start: 'bottom top',
36      endTrigger: '._footer',
37      end: 'bottom top',
38      onUpdate: (self) => {
39        if (self.direction < 0) {
40          if ($('#js-headerGroup').hasClass('_headerGroup--hide')) {
41            $('#js-headerGroup').removeClass('_headerGroup--hide');
42
43            gsap.to('#js-header', {
44              duration: .3,
45              y: '0',
46              ease: Power1.easeOut,
47              clearProps: 'all'
48            });
49          }
50        } else {
51          if (!$('#js-headerGroup').hasClass('_headerGroup--hide') & $('#js-headerGroup').find('._shoppingBag--active').length < 1) {
52            $('#js-headerGroup').addClass('_headerGroup--hide');
53
54            gsap.to('#js-header', {
55              duration: .3,
56              y: '-100%',
57              ease: Power1.easeOut
58            });
59          }
60        }
61      }
62    });
63
64    let closeModalNavLock = false;
65
66    $(window).bind('resize', function () {
67      if ($(window).width() >= 1000) {
68        if (closeModalNavLock) {
69          if ($('#js-modal-nav').hasClass('show')) {
70            $('#js-modal-nav').find('._modalNav_close').trigger('click');
71            closeModalNavLock = false;
72          }
73        } else {
74          closeModalNavLock = true;
75        }
76      }
77      _this.getHeight();
78    });
79    _this.getHeight();
80  };
81
82  HeaderGroup.prototype.checkSubNevLevel = function() {
83    if ($('._themeType__subNav-type-1').length > 0)
84    {
85      $('#js-header').find('._header_nav').find('> .has_children').each(function(idx) {
86        $(this).find('> ul').wrap('<div class="_header_subMenu"></div>');
87        
88        if ($(this).find('.has_children').length > 0)
89        {
90          if ($(this).find('._header_subMenu > ul > li').length > 3) $(this).find('._header_subMenu').addClass('_header_subMenu--full');
91          $(this).find('._header_subMenu').addClass('_header_subMenu--deep');
92          // Add level 4 submenu logic. @CLHOM
93          // $(this).find('._header_subMenu--deep > ul > li').addClass('_header_item--level3');
94          if ($('._header_subMenu--deep > ul > .has_children').find('.has_children').length > 0)
95          {
96            $(this).find('._header_subMenu--deep > ul > li').addClass('_header_item--level4');
97
98            $(this).find('._header_subMenu--deep > ul > li').bind('mouseover', function(e) {
99              e.stopPropagation();
100              var $mainMenuItem = $(this);
101              $mainMenuItem.siblings().removeClass('current')
102              $mainMenuItem.addClass('current');
103              var $mainMenu = $mainMenuItem.parent('ul');
104              var $subMenu = $mainMenuItem.find('> ul');
105              var subMenuHeight = $subMenu.outerHeight();
106              $mainMenu.css('min-height', subMenuHeight + 'px');
107            });
108
109            $(this).bind('mouseover', function() {
110              $(this).find('._header_subMenu--deep > ul > li:eq(0)').trigger('mouseover');
111            });
112          }
113          else
114          {
115            $(this).find('._header_subMenu--deep > ul > li').addClass('_header_item--level3');
116          }
117          
118          $(this).addClass('has_subMenu');
119        }
120      })
121    }
122  }
123
124  HeaderGroup.prototype.setHeight = function () {
125    let broadcastHeight = $('#js-broadcast').height(),
126      headerHeight = $('#js-header').height(),
127      borderHeight = 1;
128    $('#' + headerGroup).height(broadcastHeight + headerHeight + borderHeight);
129    
130  };
131
132  HeaderGroup.prototype.setInfoSpaceOpen = function () {
133    $('._headerGroup_wrap').css({
134      'margin-top': $('._information').height()
135    });
136  }
137
138  HeaderGroup.prototype.getHeight=function(){
139    let headerHeight = $('#js-header').height();
140    if($('._themeType__mainNavStyle--transparent').length<1){
141      $(':root').css('--layout-headerHeight',`${headerHeight}px`);
142    }
143    
144  }
145
146  HeaderGroup.prototype.setInfoSpaceClose = function () {}
147
148  $(function () {
149    _headerGroup = new HeaderGroup();
150  });
151})();

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.