I have create a logic to auto increment image height and width by using for loop in jquery but my image zoomed suddenlly ,not according to loop .Please help me to resolve my query .
Query is :- image size should be increase in four times according to loop
Thanks all
$(function() {
var plus = 50 ;
var max = 4;
setTimeout(function(){
for(var i = 0; i < max; i++) {
var height = 50;
var width = 50;
var height = height + plus;
var width = width + plus;
plus += plus;
$("#image").width(width).height(height);
}
}, 2000);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<body>
<div>
<img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQnk1kzJCdN3FFDcjMIBSNc2YuBdCuc6A5Cpzg4LIDkMB15-mek" id="image"/>
</div>
</body>