jquery插件uploadify多圖上傳功能實(shí)現(xiàn)代碼
本文實(shí)例為大家分享了uploadify多圖上傳具體實(shí)現(xiàn)代碼,可動態(tài)添加上傳框,供大家參考,具體內(nèi)容如下
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>UploadiFive Test</title> <script src="jquery2.js" type="text/javascript"></script> <script src="jquery.uploadify.min.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="uploadify.css"> <style type="text/css"> body { font: 13px Arial, Helvetica, Sans-serif; } </style> </head> <body> <h1>Uploadify Demo</h1> <div class='upload'> <form> <div class='form_file'> <div class='file'> <input id="file_upload1" name="file_upload" type="file" multiple="true"> </div> </div> </form> </div> <a href="javascript:;" class="clickUpload"> 點(diǎn)擊 </a> <script type="text/javascript"> <?php $timestamp = time();?> $(function() { var i=2; $('.clickUpload').click(function(){ var html=''; html+='<div class="file"><input id="file_upload'+i+'" name="file_upload" type="file" multiple="true"></div>'; $('.form_file').append(html); $('#file_upload'+i).uploadify({ 'formData' : { 'timestamp' : '<?php echo $timestamp;?>', 'token' : '<?php echo md5('unique_salt' . $timestamp);?>' }, 'swf' : 'uploadify.swf', 'uploader' : 'uploadify.php', 'width' : '120', 'fileTypeExts': '*.gif; *.jpg; *.png', 'buttonText': '上傳圖片', 'removeCompleted' : false, 'multi' : true, //允許多圖上傳 //上傳成功后執(zhí)行 'onUploadSuccess': function (file, data, response) { $('#' + file.id).find('.data').html(' 上傳完畢'); } }); i++; }) $('#file_upload1').uploadify({ 'formData' : { 'timestamp' : '<?php echo $timestamp;?>', 'token' : '<?php echo md5('unique_salt' . $timestamp);?>' }, 'swf' : 'uploadify.swf', 'uploader' : 'uploadify.php', 'width' : '120', 'fileTypeExts': '*.gif; *.jpg; *.png', 'buttonText': '上傳圖片', 'removeCompleted' : false, 'multi' : true, //允許多圖上傳 //上傳成功后執(zhí)行 'onUploadSuccess': function (file, data, response) { $('#' + file.id).find('.data').html(' 上傳完畢'); } }); }); </script> </body> </html>
更多精彩內(nèi)容,請點(diǎn)擊《jQuery上傳操作匯總》,進(jìn)行深入學(xué)習(xí)和研究。
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- jQuery中Nicescroll滾動條插件的用法
- jquery插件bootstrapValidator數(shù)據(jù)驗(yàn)證詳解
- jQuery插件實(shí)現(xiàn)可輸入和自動匹配的下拉框
- jQuery插件ajaxFileUpload異步上傳文件
- jQuery旋轉(zhuǎn)插件jqueryrotate用法詳解
- jQuery自適應(yīng)輪播圖插件Swiper用法示例
- jquery彈出框插件jquery.ui.dialog用法分析
- jQuery Validate插件實(shí)現(xiàn)表單驗(yàn)證
- jQuery插件EasyUI獲取當(dāng)前Tab中iframe窗體對象的方法
- 詳解jQuery插件開發(fā)方式
相關(guān)文章
javascript截圖 jQuery插件imgAreaSelect使用詳解
這篇文章主要介紹了avascript截圖 jQuery插件imgAreaSelect使用詳解,需要的朋友可以參考下2016-05-05PageSwitch插件實(shí)現(xiàn)100種不同圖片切換效果
這篇文章主要介紹了PageSwitch插件實(shí)現(xiàn)100種不同圖片切換效果,需要的朋友可以參考下2015-07-07jQuery 自動增長的文本輸入框?qū)崿F(xiàn)代碼
文本輸入框內(nèi)的字?jǐn)?shù)不能確定,而input type="text"的size是固定的,當(dāng)字?jǐn)?shù)超過size時(shí)(默認(rèn)是20),先輸入的內(nèi)容就會從文本框的左端隱藏起來,不便于輸入。2010-04-04jQuery 實(shí)現(xiàn)鼠標(biāo)畫框并對框內(nèi)數(shù)據(jù)選中的實(shí)例代碼
本文通過實(shí)例代碼給大家介紹了jQuery 實(shí)現(xiàn)鼠標(biāo)畫框并對框內(nèi)數(shù)據(jù)選中的實(shí)例代碼,非常不錯,具有參考借鑒價(jià)值,需要的朋友參考下吧2017-08-08jQuery循環(huán)遍歷子節(jié)點(diǎn)并獲取值的方法
這篇文章主要介紹了jQuery循環(huán)遍歷子節(jié)點(diǎn)并獲取值的方法,涉及jQuery節(jié)點(diǎn)的遍歷與屬性操作相關(guān)技巧,需要的朋友可以參考下2016-04-04Expandable "Detail" Table Rows
Expandable "Detail" Table Rows...2007-08-08