課程
/后端開發(fā)
/PHP
/手把手教你實(shí)現(xiàn)電商網(wǎng)站后臺(tái)開發(fā)
添加附件怎么實(shí)現(xiàn)的?點(diǎn)了沒有反應(yīng)
2016-11-21
源自:手把手教你實(shí)現(xiàn)電商網(wǎng)站后臺(tái)開發(fā) 4-9
正在回答
這里有問題吧!
你把tigger函數(shù)放在change函數(shù)體后面再試試。
//jQuery插件 <script?type="text/javascript"?src="./scripts/jquery-1.6.4.js"></script> //代碼 $(document).ready(function(){ ????????????????//添加附件按鈕???????????????? ????????????????$("#selectFileBtn").click(function(){ ????????????????????$fileField?=?$('<input?type="file"?name="thumbs[]"/>'); ????????????????????$fileField.hide(); ????????????????????$("#attachList").append($fileField); ????????????????????$fileField.trigger("click"); ????????????????????$fileField.change(function(){ ????????????????????$path?=?$(this).val(); ????????????????????$filename?=?$path.substring($path.lastIndexOf("\\")+1); ????????????????????$attachItem?=?$('<div?class="attachItem"><div?class="left">a.gif</div><div?class="right"><a?href="#"?title="刪除附件">刪除</a></div></div>'); ????????????????????$attachItem.find(".left").html($filename); ????????????????????$("#attachList").append($attachItem);???????? ????????????????????}); ????????????????}); ????????????????//<div?class="attachItem">?刪除 ????????????????$("#attachList>.attachItem").find('a').live('click',function(obj,i){ ????????????????????$(this).parents('.attachItem').prev('input').remove(); ????????????????????$(this).parents('.attachItem').remove(); ????????????????}); ????????????});
舉報(bào)
手把手教你用PHP搭建電子商務(wù)平臺(tái),由淺入深教你搭建電商系統(tǒng)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-02-16
2016-12-17
你把tigger函數(shù)放在change函數(shù)體后面再試試。
2016-11-23