Dynamic resize images in mobile & desktop
var ww = $("selector").width();
//alert(ww);
$("selector img").each(function () {
var imgwidth = $(this).width();
if (imgwidth > ww) {
$(this).css('width', '100%');
$(this).css('height', 'auto');
}
});
//alert(ww);
$("selector img").each(function () {
var imgwidth = $(this).width();
if (imgwidth > ww) {
$(this).css('width', '100%');
$(this).css('height', 'auto');
}
});
Comments
Post a Comment