problem with .blur function using jquery -
i have application zooms in image on focus()
, zooms out on blur()
. have read original image size , added 15px in order create zoom in effect, works fine. problem zoom out effect i'm trying pass original image size have read .blur()
no luck. 1 me solve issue?
here working demo of following code.
first, weren't calling $.data()
method on orgw
, orgh
in .blur()
function. also, i've altered .blur()
function have similar implementation .focus()
function in order zoom out work:
$('button:has(img)').blur(function() { if (timer !== null) cleartimeout(timer); var $image = $(this).find('img'); $image.each(function() { $(this).animate({ 'width': $.data(this, 'orgw') + 'px', 'height': $.data(this, 'orgh') + 'px', }, 500); }); });
Comments
Post a Comment