新增记录行(ecshop)
為什么80%的碼農(nóng)都做不了架構(gòu)師?>>> ??
<script type="text/javascript">
function addImg(obj)
{
var src ?= obj.parentNode.parentNode;
var idx ?= src.rowIndex;
var tbl ?= document.getElementById('gallery-table');
var row ?= tbl.insertRow(idx + 1);
var cell = row.insertCell(-1);
cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\+)/i, "$1removeImg$3$4-");
}
?
function removeImg(obj)
{
var row = obj.parentNode.parentNode.rowIndex;
var tbl = document.getElementById('gallery-table');
tbl.deleteRow(row);
}
</script>
<table width="100%" align="center" style="display: table;" id="gallery-table">
??<tbody>
?? ? <tr>
?? ? ? <td>
?? ? ? ? ?<a οnclick="addImg(this)" href="javascript:;">[+]</a>
?上傳文件 <input type="file" name="upfile[]" id="upfile" />
?? ? ? </td>
?? ? </tr>
??</tbody>
</table>
轉(zhuǎn)載于:https://my.oschina.net/netljx/blog/11226
總結(jié)
以上是生活随笔為你收集整理的新增记录行(ecshop)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: c++中的void指针和const指针
- 下一篇: Silverlight杂记-控件相关