Looking to modify the src attribute of an image
$('.bact').attr('src', '00.jpg');
00.jpg
has dimensions that are different from the original.
Is there a way to change the src
, while keeping the original image width and height?
If 00.jpg
is smaller than the original, it should be stretched (regardless of quality loss).
If it is larger, it should be clipped or adjusted to fit in the original rectangle.
Any suggestions on how to achieve this? Thank you!