Как уменьшить размер изображения в js?
// такой же код, что и код выше - только для черных пунктов меню типа Моноблоки
let categoryflag='';
$('.submenu__title a').on('click', function (event) {
event.preventDefault();
console.log('Inner check');
categoryflag=event.target.innerHTML;
subcategoryflag=categoryflag;
console.log(categoryflag);
$.ajax ({
method: 'POST',
url: '../php/ajaxsubcategory1.php',
cache: false,
data: {categoryflag: categoryflag, subcategoryflag: subcategoryflag},
dataType: 'json',
complete: function(data) {
console.log(data.header);
console.log(data.countrecords);
},
success: function (data) {
console.log('check');
console.log(data);
$('.rightmenu').html(data.result.msg);
let centeroutput='<div id=\"topcenterarea\">'+'<h1>'+data.result.header+' '+data.result.countrecords+' товара' + data.output[0]['screendiagonal'] + '</h1>'+'</div>';
productcardsoutput='';
// productcard='<div class="ProductCardBlock">';
for (let i=0; i<data.result.countrecords; i++)
{
productcard='<div class="ProductCardBlock">';
productcard+='<div class="ProductImage">';
productcard+='<img class="ProductPicture" src='+'"../images/'+data.output[i]['imagepath']+'">';
productcard+='</div>';
productcard+='</div>';
productcardsoutput+=productcard;
}
centeroutput+=productcardsoutput;
/*$('.centerarea').html('<div id=\"topcenterarea\">'+'<h1>'+data.header+' '+data.countrecords+' товара'+'</h1>'+'</div>');*/
$('.centerarea').html(centeroutput);
//expandCollapsedFunction();
}
}
);
}
);
.ProductCardBlock {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
height: 311px;
}
.ProductCardBlock .ProductImage {
/*width: calc(191.5/931.75)*100%;*/
width: 25%;
height: 100%
}
.ProductCardBlock .ProductImage .ProductPicture {
padding: auto;
}