document.path = '//web-eshop.cdn.hinet.net'; // 動態設定 meta viewport 避免平板裁切問題 // Store the meta element var viewport_meta = document.getElementById('viewport-meta'); // Define our viewport meta values var viewports = { default: viewport_meta.getAttribute('content'), landscape: 'width=1300' }; // Change the viewport value based on screen.width var viewport_set = function () { if (screen.width > 767) viewport_meta.setAttribute('content', viewports.landscape); else viewport_meta.setAttribute('content', viewports.default); } // Set the correct viewport value on page load viewport_set(); // Set the correct viewport after device orientation change or resize window.onresize = function () { viewport_set(); } div.ipmImport * { font-size: 16px !important; font-family: "PingFang TC", "SF Pro TC", "SF Pro Text", "Microsoft JhengHei", "Helvetica Neue", "Noto Sans CJK TC", Helvetica, Arial !important; } /* 221205 匯入資料區css增加 */ div.ipmImport table th[align='middle'], div.ipmImport table td[align='middle'] { text-align: -webkit-center; } div.ipmImport article table p { margin-bottom: initial; } /*--- 移除所有tooltip效果*/ svg { pointer-events: none; } function getScript(src, callback) { var script = document.createElement('script'), loaded; script.setAttribute('src', src); document.getElementsByTagName('body')[0].appendChild(script); if (callback) { script.onreadystatechange = script.onload = function () { if (!loaded) { callback(); } loaded = true; }; } } function bookmarkJS() { return { url: '/home/eshop/js/bookmark/bookmark.js', callback: function () { if (typeof jQuery != 'undefined') { $('body').append( ' ' + ' 我的收藏 ' + ' ' + ' ' + ' '); } } }; } // product card like button toggle function product_card_like_button_toggle() { var hasCollection = false; var fav = $('#fav-notification'); $('.like-button').each(function () { var self = $(this); self.on('click', function () { self.toggleClass('on'); if ($('.like-button').hasClass('on')) { if (fav.attr('data-hidden')) { fav.attr('data-hidden', ''); fav.show(); var button = $('.button', fav); button.css('width', '128px').css('color', '#fff'); fav.animate({ opacity: '1' }, 800, function () { button.delay(800).animate({ width: '44px' }, { duration: 500, step: function () { button.css("overflow", "visible"); }, complete: function () { button.css('color', 'transparent'); } }); }); } } else { fav.animate({ opacity: '0' }, 800); fav.attr('data-hidden', 'hidden'); } if (self.hasClass('on')) { AddBookmark(self.data('id'), 'bookmark', self.data('type')); } else { RemoveBookmark(self.data('id'), 'bookmark', self.data('type')) } }); // show notification after like if (hasBookmark(self.data('id'), 'bookmark', self.data('type'))) { self.addClass('on'); // show ❤ hasCollection = true; } }); fav.css('opacity', 0); if (hasCollection) { var button = $('.button', fav); button.css('width', '128px').css('color', '#fff'); fav.show().animate({ opacity: '1' }, 1000, function () { button.delay(800).animate({ width: '44px' }, { duration: 500, step: function () { button.css("overflow", "visible"); }, complete: function () { button.css('color', 'transparent'); } }); }); $('a.button.button-orange', fav).attr('href', window.favouriteUrl); } else { fav.attr('data-hidden', 'hidden'); } } //前往我的收藏 function gotofavourite() { //console.log('gotofavourite'); // product card like button navigateUrl $('.like-button').each(function () { var self = $(this); self.on('click', function () { if (self.hasClass("on")) { var type = self.data('type'); $('#fav-notification a.button.button-orange').attr('href', window.favouriteUrl + '?type=' + type); } }); }); } //tooltip reset function TooltipReset(container) { $('.tooltip', container || null).each(function () { var data = $(this).data(); $(this).tooltipster({ theme: 'tooltipster-shadow', delay: 100, delayTouch: [0, 3500], trackOrigin: true, side: data.side || 'top', }); }) } function all_init() { //$(document).ready(function () { // var iconic = IconicJS(); // iconic.inject('img.iconic', { // each: function (svg) { // // For each SVG injected // } // }, function (count) { // // Injection complete // }); //}); $(function ($) { $(".lazyload").Lazy(); }); product_card_like_button_toggle(); gotofavourite(); like_button_mouseover(); } //#endregion ////--- Loading遮罩效果 function showLoading() { $('#cht-loader').css("display", ""); } function hideLoading() { $('#cht-loader').css('display', 'none'); } function like_button_mouseover() { } function ChangeIpmImportTableCSS() { $('div.ipmImport table').each(function () { // $(this).wrapAll(' '); // $(this).addClass("table r-table ratetable"); $(this).wrapAll(' '); }) } function checkKeyWordStorage(query) { let localKeyWord = window.sessionStorage["localKeyWord"]; let arry = localKeyWord ? JSON.parse(localKeyWord) : []; let hasKeyWord = arry.indexOf(query) != -1; if (!hasKeyWord) { arry.push(query); window.sessionStorage["localKeyWord"] = JSON.stringify(arry); } return hasKeyWord; } document.scd = document.querySelector("meta[name='scd']").get

FACT BOX ・ 要点整理

  • 出典:PR Times
  • 分類:新製品
  • 関連組織:HiNet