本文介绍了如何处理img标签和其他标签上的onLoad事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何处理img标签上的onLoad事件?
how to handle onLoad Event on img tag?
示例:
$ ('img'). onload (function (e) { alert ('image loaded' + $ (this), attr ('src')); })就像imageLoader
is like the imageLoader
以及其他标签,例如脚本,链接等...
and others tags like script, link, etc...
推荐答案图片加载(即使图片已缓存)时的jQuery回调
$("img").one('load', function() { // do stuff }).each(function() { if(thisplete) $(this).load(); });似乎对我有用,应该通过缓存解决此警告.
Seems to work for me, and should fix the caveat with caching.
更多推荐
如何处理img标签和其他标签上的onLoad事件
发布评论