Run jquery image resizer after image is appended.
Posted
by Goldy
on Stack Overflow
See other posts from Stack Overflow
or by Goldy
Published on 2010-03-17T17:16:03Z
Indexed on
2010/03/17
17:21 UTC
Read the original article
Hit count: 411
jQuery
|JavaScript
Hi all,
I am using this jQuery plugin to re-size images. http://hirdet2.extra.hu/kepresize/ .
$(document).ready(function(){
$('#content img').kepresize({maxWidth: 200,maxHeight: 150});
....
....
$('#content').append('<img src="pathtofile"/>');
});
However, these images are only being appended after the document loads, depending on the users actions. Therefore the appended images are not being re-sized.
I have had a play around with .live() but can't seem to get it right.
Any help would be much appreciated.
© Stack Overflow or respective owner