Open mingzhongshui opened 7 years ago
自己找到问题了:
$list为上传图片列表的容器;
自己定义一个<div id='ptlist'></div>
然后在把$list = $('#ptlist')
在script最开始的地方把$定义好 var $ = jQuery;
改完这些后还会报错:
thumbnailWidth not define
在定义一下这两个参数
ratio = window.devicePixelRatio || 1, // 缩略图大小 thumbnailWidth = 110 * ratio, thumbnailHeight = 110 * ratio,
以上就可以解决了。
PS:吐槽:demo给的不全,是让开发者踩坑吗?demo发布出去之前自己不测试的吗?真是服了,就折腾这么个问题浪费我一上午时间
时隔两年,非常感谢~
能对你有帮助就好~
`// 当有文件添加进来的时候 uploader.on( 'fileQueued', function( file ) { var $li = $( '
});`
Uncaught ReferenceError: $list is not defined