如何一键同时下载?

时间:2019-01-11 22:20:10

标签: jquery

我尝试一键同时下载,但没有效果

$('#download-all').click(function (event) {
    event.preventDefault();
    $('.my-file').multiDownload();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://www.jqueryscript.net/demo/jQuery-Plugin-For-Simultaneous-Downloads-With-One-Click-multiDownload/jquery.multiDownload.js"></script>

<ul>
<li><a href="https://cdn.images.express.co.uk/img/dynamic/24/590x/McLaren-Senna-car-price-new-2018-890981.jpg" class="my-file">File 1</a></li>
<li><a href="https://auto.ndtvimg.com/car-images/medium/hyundai/creta/hyundai-creta.jpg" class="my-file">File 2</a>
</li>
</ul>
<a href="#" id="download-all">Download All</a>

但是有些东西不起作用

我正在使用此插件: https://github.com/biesiad/jquery-multidownload

0 个答案:

没有答案