image load

来源:互联网 发布:java 包命名特殊符合 编辑:程序博客网 时间:2024/04/30 01:55

http://stackoverflow.com/questions/3588102/jquery-load-not-working-on-my-image


            var w = 0;            var h = 0;//            image.bind("onload",function() {//                w = image.width();//                h = image.height();//            });            image.one('load', function() {                w = image.width();                h = image.height();            }).each(function() {                if (this.complete) $(this).load();            });
image为jquery image对象此事件在图片加载完时触发