PageSourceSearch

https://www.tmofa-hengshanawards.com.tw/Script/base/public.js

js tmofa-hengshanawards.com.tw collected 2026-10-06 15:03:24 UTC 13,972 bytes, 364 lines download raw bytes

1if (typeof jQuery === 'undefined') {
2  throw new Error('loadScript\'s JavaScript requires jQuery')
3}
4+function ($) {
5  'use strict';
6  var version = $.fn.jquery.split(' ')[0].split('.')
7  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
8    throw new Error('loadScript\'s JavaScript requires jQuery version 1.9.1 or higher')
9  }
10}(jQuery);
11
12
13+function ($) {
14  $(document).ready(function() {
15    'use strict';
16
17      // document.addEventListener("touchmove", function(e) {
18      //     e.preventDefault();
19      //     var touch = e.targetTouches[0];
20      //     if (touch) {
21      //         sway(touch.pageX, touch.pageY);
22      //     }
23      // });
24
25      // 搭配圖組 才要引用
26      $(".openImg").on('click', function(e) {
27        e.preventDefault();
28        var self = $(this);
29        
30        $.colorbox({
31          href: self.data("href"),
32          rel: 'group1',
33          maxWidth: "90%",
34          maxHeight: "90%"
35        });
36      });
37
38      // 搭配影片(播放方式 直接播放 / 非自行上傳)才要引用
39      // $(".openVideoImg").on('click', function(e) {
40      //   e.preventDefault();
41      //   var video = '<div class="videoCurrentBox"><a href="javascriot:"><i class="cc cc-close"></i></a><iframe src="'+ $(this).data('href') +'" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>';
42      //   // var $video = $(this).find('.videoCurrentBox')[0];
43      //   if ($(this).find('.videoCurrentBox').length) {
44        
45      //     // $video.remove();
46      //   $(this).find('.videoCurrentBox').remove();
47      //   $('.header').removeClass('playVideo'); 
48      //   $(this).parents('.flexsliderV').removeClass('playVideo'); 
49
50      //   } else {
51      //     $('.videoCurrentBox').remove();
52      //     $(this).prepend(video);
53      //     $('.header').addClass('playVideo'); 
54      //     $(this).parents('.flexsliderV').addClass('playVideo');
55      //   }
56      // });
57      // $('.openVideoImg > .videoCurrentBox > a').on('click', function(){
58      //   $video.remove();
59      //   $('.header').removeClass('playVideo'); 
60      //   $(this).parents('.flexsliderV').removeClass('playVideo'); 
61      // });
62
63      // 搭配影片(播放方式 燈箱 / 非自行上傳)才要引用
64      $(".openVideo").on('click', function(e) {
65        e.preventDefault();
66        var self = $(this);
67        
68        $.colorbox({
69          href: self.data("href"),
70          iframe:true,
71          width: "1408px",
72          height: "792px",
73          maxWidth: "90%",
74          maxHeight: "90%"
75        });
76      });
77
78      // 搭配影片(播放方式 燈箱 / 自行上傳) 才要引用
79      $(".openJWPlayer").on('click', function (e) {
80        e.preventDefault();
81        var self = $(this);
82
83          $.colorbox({
84              html: '<div id="' + self.data("id") + '"></div>',
85              width: "1408px",
86              height: "792px",
87              maxWidth: "90%",
88              maxHeight: "90%",
89              scrolling: false,
90              fixed: true,
91
92              title: function() {
93                var $title = self.data('title');
94                if($title.length > 0) {
95                  return $title;
96                }
97              },
98              onComplete: function() {
99                jwplayer(self.data("id")).setup({
100                    file: self.data("file"),
101                    image: self.data("image"),
102                    width: "auto",
103                    height: "100%",
104                    type: "mp4",
105                    skin: {
106                      name:"default",//選擇主題
107                      active: "#2e2e2e",//選擇主色
108                      inactive: "#ffffff",
109                      background: "#000000"//選擇背景
110                    },
111                    showdownload: false,
112                    aspectratio: "16:9",//影片比例
113                    autostart: false //自動播放
114                });
115              },
116              // onClosed: function() {
117              // }
118          });
119      });
120
121      // 搭配聲音 才要引用
122      $(".openVoice").on('click', function (e) {
123        e.preventDefault();
124        var self = $(this);
125
126          $.colorbox({
127              html: '<div id="' + self.data("id") + '"></div>',
128              width: "270px",
129              height: "30px",
130              maxWidth: "90%",
131              maxHeight: "90%",
132              scrolling: false,
133              fixed: true,
134              onComplete: function() {
135                jwplayer(self.data("id")).setup({
136                    file: self.data("voice"),
137                    width: "270",
138                    height: "30",
139                    type: "mp3",
140                    skin: {
141                      name:"default",//選擇主題
142                      active: "#2e2e2e",//選擇主色
143                      inactive: "#ffffff",
144                      background: "#000000"//選擇背景
145                    },
146                    autostart: true
147                });
148              }
149          });
150      });
151
152      // if ($(".swiper-container").length > 0) {
153      //   var swiper = new Swiper('.swiper-container', {
154      //               // pagination: '.swiper-pagination',
155      //               slidesPerView: 'auto',
156      //               centeredSlides: true,
157      //               paginationClickable: true,
158      //               nextButton: '.swiper-button-next',
159      //               prevButton: '.swiper-button-prev',
160      //               spaceBetween: 0,
161      //               initialSlide: 2
162      //   });
163      // }
164
165
166      if (('#socialMore').length) {
167        $('#socialMore').on('click', function () {
168          var $this = $(this);
169          var moreShareCount = $this.attr("dada-count");
170
171          console.log("a");
172
173          if(moreShareCount != null && moreShareCount >= 0)
174          {
175              if ($this.hasClass('icon-close')) {
176                  console.log("5555555555555555555");
177                  var items = $('#socialShareBox').children('a:gt('+moreShareCount+')');
178                  var len = items.length;
179                  items.fadeOut();
180                  $this.removeClass('icon-close').fadeIn();
181              } else {
182                  console.log("--------------------------------");
183                  var items = $('#socialShareBox').children('a:hidden');
184                  var len = items.length;
185                  items.fadeIn();
186                  $this.addClass('icon-close').fadeIn();
187              }
188          }
189          
190          // if ($this.hasClass('icon-close')) {
191          //   var items = $('#socialShareBox').children('a:gt(2)');
192          //   var len = items.length;
193            // function fade(index) {
194            //   if (index < 0) {
195            //     $this.fadeOut(function () {
196            //       $this.removeClass('icon-close').fadeIn();
197            //     });
198            //     return;
199            //   }
200            //   items.eq(index).fadeOut(function () {
201            //     fade(--index);
202            //   },0);
203            // }
204            // fade(len - 1);
205          //   items.fadeOut();
206          //   $this.removeClass('icon-close').fadeIn();
207          // } else {
208          //   var items = $('#socialShareBox').children('a:hidden');
209          //   var len = items.length;
210            // function fade(index) {
211            //   if (index == len) {
212            //     $this.fadeOut(function () {
213            //       $this.addClass('icon-close').fadeIn();
214            //     });
215            //     return;
216            //   }
217            //   items.eq(index).fadeIn(function () {
218            //     fade(++index);
219            //   },0);
220            // }
221            // fade(0);
222            // items.fadeIn();
223            // $this.addClass('icon-close').fadeIn();
224          // }
225        });
226      }
227      
228      //手機版分享 點擊展開全部分享
229      if (('.mobile-controlBars').length) {
230        $(document).scroll(function () {
231            var y = $(this).scrollTop();
232            if (y > 200) {
233                $('.mobile-controlBars').addClass('active');
234            }
235            else {
236                $('.mobile-controlBars').removeClass('active');
237            }
238        });
239        $('#mobile-socialMore').on('click',function(){
240          if ( $(this).hasClass('active') ) {
241            $(this).siblings('.extraDiv').slideUp(600);
242            $(this).siblings('.overlayer').fadeOut();
243            $(this).removeClass('active');
244            //$('html,body').removeAttr('style');
245          } else {
246            $(this).siblings('.extraDiv').slideDown(600);
247            $(this).siblings('.overlayer').fadeIn();
248            $(this).addClass('active');
249            //$('html,body').css({'position':'fixed','width':'100%','left':'0','top':'0','height':'0','overflow-y':'hidden'});
250          }
251        });
252        $('#extra-close').on('click',function(){
253          if ( $(this).closest('.extraDiv').siblings('#mobile-socialMore').hasClass('active') ) {
254            $(this).closest('.extraDiv').slideUp(600);
255            // 20181204 yulin 新增購物車按鈕
256            // $(this).closest('.extraDiv').next('.overlayer').fadeOut();
257            $(this).closest('.extraDiv').siblings('.overlayer').fadeOut();
258            $(this).closest('.extraDiv').siblings('#mobile-socialMore').removeClass('active');
259            //$('html,body').removeAttr('style');
260          } else {
261            $(this).closest('.extraDiv').slideDown(600);
262            // $(this).closest('.extraDiv').next('.overlayer').fadeIn();
263            // 20181204 yulin 新增購物車按鈕
264            $(this).closest('.extraDiv').siblings('.overlayer').fadeIn();
265            $(this).closest('.extraDiv').siblings('#mobile-socialMore').addClass('active');
266            //$('html,body').css({'position':'fixed','width':'100%','left':'0','top':'0','height':'0','overflow-y':'hidden'});
267          }
268        });
269
270        // 20181204 yulin 手機板購物車
271        // $('#mobile-buy').on('click',function(){
272        //   if ( $(this).hasClass('active') ) {
273        //     $(this).siblings('.buyDiv').slideUp(600);
274        //     $(this).siblings('.overlayer').fadeOut();
275        //     $(this).removeClass('active');
276        //   } else {
277        //     $(this).siblings('.buyDiv').slideDown(600);
278        //     $(this).siblings('.overlayer').fadeIn();
279        //     $(this).addClass('active');
280        //   }
281        // });
282        // $('#buy-close').on('click',function(){
283        //   if ( $(this).closest('.buyDiv').siblings('#mobile-buy').hasClass('active') ) {
284        //     $(this).closest('.buyDiv').slideUp(600);
285        //     // 20181204 yulin 新增購物車按鈕
286        //     // $(this).closest('.buyDiv').next('.overlayer').fadeOut();
287        //     $(this).closest('.buyDiv').siblings('.overlayer').fadeOut();
288        //     $(this).closest('.buyDiv').siblings('#mobile-buy').removeClass('active');
289        //     //$('html,body').removeAttr('style');
290        //   } else {
291        //     $(this).closest('.buyDiv').slideDown(600);
292        //     // $(this).closest('.buyDiv').next('.overlayer').fadeIn();
293        //     // 20181204 yulin 新增購物車按鈕
294        //     $(this).closest('.buyDiv').siblings('.overlayer').fadeIn();
295        //     $(this).closest('.buyDiv').siblings('#mobile-buy').addClass('active');
296        //     //$('html,body').css({'position':'fixed','width':'100%','left':'0','top':'0','height':'0','overflow-y':'hidden'});
297        //   }
298        // });
299
300      }
301  })
302}(jQuery);
303
304function breakpoint($winWidth = null, $centerWidth = null) {
305        if ($.isMobile()) {
306          $("[data-sticky_column]").trigger("sticky_kit:detach");
307
308        } else {
309          var $headerHeight = $('#header').outerHeight();
310          $("[data-sticky_column]").stick_in_parent({
311            parent: "[data-sticky_parent]",
312            // bottoming : false,
313            //spacer: false,
314            //inner_scrolling: false,
315            offset_top: $headerHeight
316          });
317          if($('.article-left').length) {
318            $('.article-main').addClass('hasLeft');
319          }
320          if($('.article-right').length) {
321            $('.article-main').addClass('hasRight');
322          }
323          
324          $('.article-center .card').each(function(){
325            var $this = $(this),
326              $width = $this.width(),
327              $pWidth = $this.parents('.groove').outerWidth(),
328              //$winWidth = $(window).width(),
329              $imgBox = $this.find('.card-img'),
330              $slider = $this.find('.flexslider'),
331              $imgInfoW = $this.find('.imgInfo');       
332
333            if ($this.hasClass('imgWidth-large')) {
334              if($slider.length) {
335                $slider.css({
336                  width: $pWidth
337                });
338              } else {
339                $imgBox.css({
340                  width: $pWidth
341                });
342              }
343            }
344            if ($this.hasClass('original')) {
345            
346              if($slider.length) {
347                $slider.css({
348                  width: $winWidth
349                });
350                $imgInfoW.css({
351                  width: $centerWidth
352                });
353              }
354              if($imgBox.hasClass('text-C')) {
355                if($slider.length) {
356                  $slider.css({
357                    'margin-left': -(($winWidth/2)+20)
358                  });
359                }
360              }
361            }
362          });
363        }
364      }

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.