i have an series of images whose width and height varies. in my application i need to gradually grow image when it gets focus.after image loads i have used
var w='img.width' var h='img.height'
to get width and height of image. now how do i add some value say 10px to both width and height so that i can pass this values to grow function.
<script type='text/javascript'>
$(window).load(function(){
var timer = null;
$(function() {
$('button:has(img)').focus(function() {
var $image = $(this).find('img');
timer = setTimeout(function() {
var w = 'img.width';
var h = 'img.height';
var zoominw= w+10;
var zoominh=h+10;
$image.animate({
'width': 'zoominw',
'height': 'zoominh'
}, 500);
}, 2000);
}).blur(function() {
if (timer != null)
clearTimeout(timer);
$(this).find('img').animate({
'width': 'imgwidth',
'height': 'imgheight'
}, 500);
});
});
});
</script>