<div class="uploader-list am-cf">
<?php foreach ($model['image'] as $key => $item): ?>
<div class="file-item">
<a href="<?= $item['file_path'] ?>" title="点击查看大图" target="_blank">
<img src="<?= $item['file_path'] ?>">
</a>
<input type="hidden" name="goods[images][]"
value="<?= $item['image_id'] ?>">
<i class="iconfont icon-shanchu file-item-delete"></i>
</div>
<?php endforeach; ?>
</div>
//js
$('.uploader-list').DDSort({
target: '.file-item',
delay: 100, // 延时处理,默认为 50 ms,防止手抖点击 A 链接无效
floatStyle: {
'border': '1px solid #ccc',
'background-color': '#fff'
}
});
插件下载:https://github.com/Barrior/DDSort