$(window).resize(function() {
let resizeWidth = $(window).width();
if(resizeWidth > 560) {
$('#img-1').attr("href","../css/images/image-1-1000.jpg");
$('#img-1 > .block-8_container_images_border__image').attr("src","../css/images/image-1-500.jpg");
$('#img-2').attr("href","../css/images/image-2-1000.jpg");
$('#img-2 > .block-8_container_images_border__image').attr("src","../css/images/image-2-500.jpg");
$('#img-3').attr("href","../css/images/image-3-1000.jpg");
$('#img-3 > .block-8_container_images_border__image').attr("src","../css/images/image-3-500.jpg");
$('#img-4').attr("href","../css/images/image-4-1000.jpg");
$('#img-4 > .block-8_container_images_border__image').attr("src","../css/images/image-4-500.jpg");
$('#img-5').attr("href","../css/images/image-5-1000.jpg");
$('#img-5 > .block-8_container_images_border__image').attr("src","../css/images/image-5-500.jpg");
$('#img-6').attr("href","../css/images/image-6-1000.jpg");
$('#img-6 > .block-8_container_images_border__image').attr("src","../css/images/image-6-500.jpg");
}
});
$(window).resize(function() {
let resizeWidth = $(window).width();
if(resizeWidth > 560 && localstorage.getItem('resized')) {
localstorage.setItem('resized', 'true');
$('#img-1').attr("href","../css/images/image-1-1000.jpg");
$('#img-1 > .block-8_container_images_border__image').attr("src","../css/images/image-1-500.jpg");
$('#img-2').attr("href","../css/images/image-2-1000.jpg");
$('#img-2 > .block-8_container_images_border__image').attr("src","../css/images/image-2-500.jpg");
$('#img-3').attr("href","../css/images/image-3-1000.jpg");
$('#img-3 > .block-8_container_images_border__image').attr("src","../css/images/image-3-500.jpg");
$('#img-4').attr("href","../css/images/image-4-1000.jpg");
$('#img-4 > .block-8_container_images_border__image').attr("src","../css/images/image-4-500.jpg");
$('#img-5').attr("href","../css/images/image-5-1000.jpg");
$('#img-5 > .block-8_container_images_border__image').attr("src","../css/images/image-5-500.jpg");
$('#img-6').attr("href","../css/images/image-6-1000.jpg");
$('#img-6 > .block-8_container_images_border__image').attr("src","../css/images/image-6-500.jpg");
}
});
$(window).resize(
debounce(function () {
let resizeWidth = $(window).width();
let img_count = 6;
if (resizeWidth > 560) {
for (let i = 1; i <= img_count; i++) {
$('#img-' + i).attr("href", "../css/images/image-" + i + "-1000.jpg");
$('#img-' + i + ' > .block-8_container_images_border__image').attr("src", "../css/images/image-" + i + "-500.jpg");
}
}
}, 500))
function debounce(func, wait, immediate = false) {
let timeout;
return function () {
let context = this, args = arguments;
let later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
let callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};