javascript - I want to use an onload function on an image in Jquery -
i need check when image loaded. result has this:
$('.testimage').onload(function() { // stuff });
all appreciated.
there no onload
method in jquery (although there underlying onload
property on raw dom). there load
method (confusingly) has different meanings (see http://api.jquery.com/load-event/ , http://api.jquery.com/load/ ) depending on context use in, , version attaches load event handler has been deprecated.
the standard jquery way attach event handlers via on
method:
$('.testimage').on('load', function() { // stuff });
Comments
Post a Comment