');
var maxHeight = $(window).height() - 120 + "px";
var maxWidth = $("#jp_modal_div .w3-container").width() - 40 + "px";
//$("#jp_modal_div .w3-container img").css("max-height", maxHeight);
//$("#jp_modal_div .w3-container video").css("max-height", maxHeight);
$("#jp_modal_div .w3-container img").css("max-height", maxHeight);
$("#jp_modal_div .w3-container img").css("max-width", maxWidth);
$("#jp_modal_div .w3-container video").css("max-height", maxHeight);
$("#jp_modal_div .w3-container video").css("max-width", maxWidth);
}
window.addEventListener("resize", showDivs);
$(document).ready( function() {
/* 20190321 */
var title = '';
var lang = '';
if ($(location).attr('href').indexOf('/sc/') > -1) {
title = '
最新推介
';
} else if ($(location).attr('href').indexOf('/en/') > -1) {
title = '
Monthly Promotion
';
} else {
title = '
最新推介
';
}
// for popup
$('#jp_modal_div').html('
'
+ '×'
+ title
+ ''
+ '
'
// + ' '
+ ' '
+ ' '
+ '
'
+ '
'
);
var hours = 1; // Reset when storage is more than 24hours
//var hours = 0;
var now = new Date().getTime();
var popupTime = localStorage.getItem('popupTime');
if (popupTime == null) {
localStorage.setItem('popupTime', now)
$('#jp_modal_div').show();
$('#product_carousel').hide();
showDivs(jpSlideIndex);
} else {
if(now-popupTime > hours*60*60*1000) {
//if(now-popupTime > 10*1000) {
$('#jp_modal_div').show();
$('#product_carousel').hide();
localStorage.clear()
localStorage.setItem('popupTime', now);
showDivs(jpSlideIndex);
}
}
jpPath();
})
function jpPath() {
/* 20200205 */
var $path = $('.breadcrumb li');
if ($path.length) {
//console.log('not null');
//if ($path.length == 2) break;
//console.log($path.length);
var num = $path.length;
var urlLan = '';
$path.each(function( index ) {
//console.log( index + ": " + $( this ).text() + 'url='+$(this).find('a').attr('href') + ' class='+$(this).attr('class') );
if (index == 0) {
var url = $(this).find('a').attr('href');
if (url.length <= 1) {
urlLan = '/tc';
} else {
urlLan = url;
}
} else if (index >= (num-1)) {
} else {
var url = '';
switch($(this).text()) {
case '蒸餾水':url='cat_distilled_water';break;
case '飲水機':url='cat_water_dispenser';break;
case '咖啡機':url='cat_coffee_machine';break;
case '過濾系統':url='cat_filtration_system';break;
case '空氣過濾':url='product/details/53';break;
case '熱水器':url='product/water_boiler';break;
case '茶水手推車':url='product/details/22';break;
case '蒸馏水':url='cat_distilled_water';break;
case '饮水机':url='cat_water_dispenser';break;
case '咖啡机':url='cat_coffee_machine';break;
case '过滤系统':url='cat_filtration_system';break;
case '空气过滤':url='product/details/53';break;
case '热水器':url='product/water_boiler';break;
case '茶水手推车':url='product/details/22';break;
case 'Distilled Water':url='cat_distilled_water';break;
case 'Water Dispenser':url='cat_water_dispenser';break;
case 'Coffee Machine':url='cat_coffee_machine';break;
case 'Filtration System':url='cat_filtration_system';break;
case 'Air Purification':url='product/details/53';break;
case 'Water Boiler':url='product/water_boiler';break;
case 'Mobile Refreshment':url='product/details/22';break;
case '上流式飲水機':url='product/uplifting_water_dispenser';break;
case '傳統式飲水機':url='product/traditional_water_dispenser';break;
case '飲用噴泉機/盆':url='product/drinking_water_fountain';break;
case '冰塊及冷熱溫水機':url='product/details/7';break;
case '濾水式飲水機':url='product/filtration_water_dispenser';break;
case '雅潔蒸餾水':url='product/details/11';break;
case '純天然礦泉水':url='product/details/12';break;
case '雅潔過濾系統':url='product/ro_filtration';break;
case '雅潔空氣過濾系統':url='product/details/53';break;
case '雅潔節能迅熱熱水器':url='product/water_boiler';break;
case '「雅潔」超動感茶水手推車':url='product/details/22';break;
case '即磨咖啡機':url='product/beans_to_cup_coffee_machine';break;
case '咖啡粉機':url='product/instant_coffee_machine';break;
case '膠囊咖啡機':url='product/capsule_machine';break;
case '上流式饮水机':url='product/uplifting_water_dispenser';break;
case '传统式饮水机':url='product/traditional_water_dispenser';break;
case '饮用喷泉机/盆':url='product/drinking_water_fountain';break;
case '冰块及冷热温水机':url='product/details/7';break;
case '滤水式饮水机':url='product/filtration_water_dispenser';break;
case '雅洁蒸馏水':url='product/details/11';break;
case '纯天然矿泉水':url='product/details/12';break;
case '雅洁过滤系统':url='product/ro_filtration';break;
case '雅洁空气过滤系统':url='product/details/53';break;
case '雅洁节能瞬热热水器':url='product/water_boiler';break;
case '「雅洁」超动感茶水手推车':url='product/details/22';break;
case '即磨咖啡机':url='product/beans_to_cup_coffee_machine';break;
case '咖啡粉机':url='product/instant_coffee_machine';break;
case '胶囊咖啡机':url='product/capsule_machine';break;
case 'Uplifting Water Dispenser':url='product/uplifting_water_dispenser';break;
case 'Traditional Water Dispenser':url='product/traditional_water_dispenser';break;
case 'Drinking Water Fountains':url='product/drinking_water_fountain';break;
case 'Ice cube, hot, cold and ambinet water dispenser':url='product/details/7';break;
case 'Filtration Water Dispenser':url='product/filtration_water_dispenser';break;
case 'Aqua-Tek Distilled Water':url='product/details/11';break;
case 'Natural Mineral Water':url='product/details/12';break;
case 'Aqua-Tek Filtration System':url='product/ro_filtration';break;
case 'Aqua-Tek Air Purification System':url='product/details/53';break;
case 'Aqua-Tek Energy Saving Instant Water Boiler':url='product/water_boiler';break;
case 'Mobile Refreshment Center ':url='product/details/22';break;
case 'Beans To Cup Coffee Machine':url='product/beans_to_cup_coffee_machine';break;
case 'Instant Coffee Machine':url='product/instant_coffee_machine';break;
case 'Capsule Machine':url='product/capsule_machine';break;
} // end switch
$(this).html(''+$(this).text()+'');
//console.log($(this).html());
}
});
} else {
//console.log('null');
}
} //end jpPath
// for popup
/*
+ ''
+ ' '
+ ' '
+ ' '
+ ''
*/
/*
if(localStorage.getItem('popState') != 'shown'){
//$("#popup").delay(2000).fadeIn();
$('#jp_modal_div').show();
$('#product_carousel').hide();
localStorage.setItem('popState','shown')
}
*/