JS image resize
JS image resize
Out of context: Reply #7
- Started
- Last post
- 8 Responses
- qoob0
Thanks everyone. FYI, this is what I settled on:
https://github.com/adeelejaz/jqu…
And then added the function:
function imgResize() {
$("img").each(function(index, value) {
parentHeight = $(this).parent().height();
parentWidth = $(this).parent().width();
$(this).aeImageResize({ height: parentHeight, width: parentWidth });
});
};
$(window).resize(function(){
mgResize();
});That will resize every image to the size of the width or height of its container, keeping the aspect ratio.
- Typo in second to last line...should be "imgResize();"qoob