<td>
<span class="preview">
<a class="fancyOpen" title="Processed Image" href="'+o["files"][i].url+'">
<img src="'+o["files"][i].thumbnail_url+'" />
</a>
<a class="fancyOpen" title="Original Image" href="'+base_url+"files/upload?t=r&getfile="+o["files"][i].name+'">
<img src="'+base_url+"files/upload?t=r&getthumb="+o["files"][i].name+'" />
</a>
</span>
</td>
如何在已处理图像和原始图像之间添加下一个选项?
答案 0 :(得分:1)
function before(node, insertNode){
return node && insertNode && node.parentNode?
node.parentNode.insertBefore(insertNode, node):
false;
}
function after(node, insertNode){
return node && insertNode && node.parentNode?
before(node.nextSibling, insertNode) || node.parentNode.appendChild(insertNode):
false;
}
after( document.querySelector('.fancyOption'), nextOption );
其中nextOption必须是Dom-Node