How to set image height and width dynamically using jquery.

image-size

Here in this quick tutorial, I am going to show you that how you can easily assign image height and width dynamically using .height() and .width() function in jquery. Some time you need to require images in different different sizes for your application, You can use this quick jquery method to re-size your images as you can display many thumbnail images from single image.

Note: This method will not optimize image, By this method you can only quickly re-size image sizes on run-time, For optimizing images you must have to crop images in different different sizes on runtime. But if you want quick solution then you can follow this approach.
image-size
First of all include javascript on your page.

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">script>
head>
<body>
    <img />
body>
html>