Zoom out image in center using JQUERY?

Brian33

New Member
I want to animate the image and keep it exactly in the center of the currently opened window.I have tried the following, but it is not working please suggest how to improve the code to get it working.\[code\] // get image dimensions var h = $(this).height(); var w = $(this).width(); //get div dimensions var div_h =$('#imgContainer').height(); var div_w =$('#imgContainer').width(); var pY = Math.round((div_h - h) / 2) + 'px'; var pX = Math.round((div_w - w) / 2) + 'px'; $(this).animate({ opacity:"1", top: pY+"px", left: pX+"px", zoom: '500%' }, 'medium')\[/code\]
 
Top