Kindeditor单独调用多图上传实例

前端之家收集整理的这篇文章主要介绍了Kindeditor单独调用多图上传实例前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

HTML代码

'/>">

<input type='hidden' thumbID="p_<?=$row['id']?>" value='<?=$row['thumbnailurl']?>' name='thumbPath[]' >
<input type='hidden' thumbID="p
<?=$row['id']?>" value='<?=$row['file_url']?>' name='imagePath[]'>
<?php endforeach;?>

JS代码

function clearUploadPic(i,obj){ $("input[preImagePathId="+i+"]").val(""); $("input[preThumbPathId="+i+"]").val(""); obj.remove(); } KindEditor.ready(function(K) { window.editor = K.create('#editor_id',{ height:'500px',uploadJson: '',items : [ 'source','fontname','fontsize','|','forecolor','hilitecolor','bold','italic','underline','removeformat','justifyleft','justifycenter','justifyright','insertorderedlist','insertunorderedlist','image']

});

K('#J_selectImage').click(function() {
editor.loadPlugin('multiimage',function() {
editor.plugin.multiImageDialog({
clickFn : function(urlList) {
var div = K('#J_imageView');
//div.html('');
K.each(urlList,function(i,data) {

div.append('<div class="img_view"><img src="' + data.url + '"><span class="view_del" onclick="clearUploadPic('+i+',$(this).parent())"><img src="/Public/Home/img/close_delete_2.png">

');
div.append('<input preImagePathId="'+i+'" name="imagePath[]" class="image-path" type="hidden" value="' + data.url +'">');
div.append('<input preThumbPathId="'+i+'" name="thumbPath[]" class="thumb-path" type="hidden" value="' + data.mini_url + '">');
//$("#thumbPath").val($("#thumbPath").val()+""+ data.mini_url);
});
editor.hideDialog();
}
});
});
});
})

以上这篇Kindeditor单独调用多图上传实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。

猜你在找的JavaScript相关文章