合わせてチェックされています
136420
4
[JP_10046_183570, JP_10046_194354, JP_10046_163543]
[JP_10046_183570, JP_10046_194354, JP_10046_163543]
0
').addClass('d-flex align-items-center pt-4');
for (let i = 0; i < 5; i++) {
if(i < solidStars) newDiv.append('
');
else newDiv.append('
');
}
newDiv.append('
'+solidStars.toFixed(2)+'');
newDiv.append('
'+review+'');
link.append(newDiv);
$(this).find('.star').remove();
$(this).find('.reviews').remove();
}
});
// Silveregg Section START
var silvereggSlider = $('.silveregg-slider');
var silvereggResizeTimer = undefined;
var silvereggWindowWidth = window.innerWidth;
if(silvereggWindowWidth > 991) {
silvereggSlider.slick({
slidesToShow: 6,
swipeToSlide: false,
touchThreshold: 1000,
arrows: true,
infinite: false,
variableWidth: true,
prevArrow: '
',
nextArrow: '
',
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 3
}
},
{
breakpoint: 1450,
settings: {
slidesToShow: 5
}
}
]
});
}
$(window).on('resize',function() {
if(window.innerWidth != silvereggWindowWidth){
silvereggWindowWidth = window.innerWidth;
clearTimeout(silvereggResizeTimer);
silvereggResizeTimer = setTimeout(function () {
if(window.innerWidth <= 991) {
if(silvereggSlider.hasClass('slick-initialized')){
silvereggSlider.slick('unslick');
}
}else {
silvereggSlider.not('.slick-initialized').slick({
slidesToShow: 6,
swipeToSlide: false,
touchThreshold: 1000,
arrows: true,
infinite: false,
variableWidth: true,
prevArrow: '
',
nextArrow: '
',
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 3
}
},
{
breakpoint: 1450,
settings: {
slidesToShow: 5
}
}
]
});
}
}, 100);
}
});
// Silveregg Section END
}
function getCarouselTimer() {
var carousel_timer = (Math.floor(Math.random() * 20) + 1) * 100;
return carousel_timer;
}
function initializeCarousel() {
$('.container-silveregg-carousel').removeClass('d-none');
$('.container-silveregg-carousel').show();
$('.container-silveregg-carousel .dv_recommend').addClass('vcarousel silveregg-carousel horizontal-scroll-container pl-16 pr-24 px-md-0 pb-20 pb-lg-0').css('scrollbar-color', '#fff #fff');
$('.container-silveregg-carousel .dv_recommend').attr('data-visible-count', 2);
$('.container-silveregg-carousel .dv_recommend').attr('data-visible-desktop-count', 6);
$('.container-silveregg-carousel .dv_recommend').children(':not(.dv_rc_items)').remove();
// $('.silveregg .dv_recommend a').addClass('text-black');
$('.container-silveregg-carousel .dv_rc_items').addClass('horizontal-scroll-col slick-slide');
// $('.silveregg .dv_rc_items').addClass('silveregg-card card');
// $('#recommend-ac-top-page .dv_rc_items').addClass('mr-lg-20');
// $('#recommendation-ac-2 .dv_rc_items').addClass('px-0 w-100');
$('.container-silveregg-carousel .dv_rc_img').addClass('lazyload-wrapper mb-8');
$('.container-silveregg-carousel .dv_rc_img img').addClass('lazyload rounded');
$('.container-silveregg-carousel .dv_rc_name').addClass('fs-14 mb-4 text-truncate-2 text-black');
$('.container-silveregg-carousel .dv_rc_price p').addClass('fs-14 mb-4 text-red');
$('.container-silveregg-carousel .dv_rc_items').each(function() {
let link = $(this).find('a');
link.append($(this).find('.dv_rc_price'));
$(this).css('display', 'block');
$(this).find('.dv_rc_description').remove();
if($(this).find('.star').length){
let star = $(this).find('.star').text();
let review = $(this).find('.reviews').text();
let solidStars = (star.match(/★/g) || []).length; // Count solid stars
let newDiv = $('
').addClass('d-flex align-items-center pt-4');
for (let i = 0; i < 5; i++) {
if(i < solidStars) newDiv.append('
');
else newDiv.append('
');
}
newDiv.append('
'+solidStars.toFixed(2)+'');
newDiv.append('
'+review+'');
link.append(newDiv);
$(this).find('.star').remove();
$(this).find('.reviews').remove();
}
});
// Select all elements you want to wrap
const allItems = document.querySelectorAll('.container-silveregg-carousel .dv_recommend .dv_rc_items');
// Loop through each element
allItems.forEach((item) => {
let elementToWrap = item.querySelector('a')
// Create a new div element for each
const wrapperDiv = document.createElement('div');
// Insert the wrapperDiv before the element
elementToWrap.parentNode.insertBefore(wrapperDiv, elementToWrap);
// Move the element inside the wrapperDiv
wrapperDiv.appendChild(elementToWrap);
});
// Silveregg Section START
setTimeout(function(){
var slidesToShowValue = window.innerWidth <= 992 ? 2.2 : 1; // 2.2 slides for mobile, 1 for other screens
$('.silveregg-carousel').vcarousel({
slidesToScroll: 1,
slidesToShow: slidesToShowValue, // Dynamically set slidesToShow based on window width
dots: false,
navArrowTheme: 2,
});
}, getCarouselTimer());
$(window).on('resize', function() {
var newSlidesToShowValue = window.innerWidth <= 992 ? 2.2 : 1;
$('.silveregg-carousel').vcarousel('slickSetOption', 'slidesToShow', newSlidesToShowValue, true);
});
// Silveregg Section END
}
// # 63540 - If res_complete_flg, perform multiple script generation for recommendations
var res_complete_flg = "";
var multiple_target_page_flg = [];
(function() {
if (recommendAcCookieIdValue == null) {
recommendAcCookieIdValue = recommendAcRandomKey;
}
// Load multiple recommendations, if multiple target_page are found
if ( ( Array.isArray(multiple_target_page_flg) || multiple_target_page_flg.length) && res_complete_flg ) {
for (var i = 0; i < multiple_target_page_flg.length; i++) {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//veltra.silveregg.net/suite/page?m=veltra&p='+ multiple_target_page_flg[i] + '&cookie=' + recommendAcCookieIdValue + '&t='+(new Date()).getTime()+'&r='+escape(document.referrer);
var e = document.getElementsByTagName('script')[0];
e.parentNode.insertBefore(s,e);
}
// Load single recommendation
} else{
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//veltra.silveregg.net/suite/page?m=veltra&p=pc_pddt&cookie=' + recommendAcCookieIdValue + '&t='+(new Date()).getTime()+'&r='+escape(document.referrer);
var e = document.getElementsByTagName('script')[0];
e.parentNode.insertBefore(s,e);
}
// 69583
var div_recommend = document.getElementsByClassName("dv_recommend");
var sliderSelector2 = document.querySelector('.slick-track');
if (window.MutationObserver) {
var rec_observer = new MutationObserver(function(mutations) {
if (document.querySelector('.dv_recommend') != null) {
document.getElementById("recommendation-ac").style.display = "block";
rec_observer.disconnect();
}
});
if(document instanceof Node) {
rec_observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
}
var sliderSelector = document.querySelector('.is_slider');
var rec_observer_slider = new MutationObserver(function(mutationsList) {
for (const mutation of mutationsList) {
var addedLists = mutation.addedNodes;
for (const node of addedLists) {
if (node.className && node.className.indexOf('dv_recommend') !== -1) {
initializeCarousel();
rec_observer_slider.disconnect();
break; // Exit the loop once the condition is met
}
}
}
});
if(sliderSelector instanceof Node) {
rec_observer_slider.observe(sliderSelector, {attributes: false, childList: true, characterData: false, subtree:true});
}
} else {
document.getElementById("recommendation-ac").style.display = "block";
}
})();
}); // close curly brace for window.onload = function()