html += '</div>';
$(this).siblings('.showImgDiv').html(html);
}
}else{
var objUrl = getObjectURL2($(this).get(0).files);
if (objUrl) {
var showImgWidth = $(this).siblings('.showImgDiv').attr('showImgWidth');
if(!showImgWidth)
{
showImgWidth = '150';
}
var html = '';
for(var i=0;i<objUrl.length;i++)
{
html += '<div style="margin-bottom:5px;border:1px solid #000;position:relative;z-index:2;overflow:hidden;cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;" index="'+i+'" class="fullDiv">';
html += '<div style="position:absolute;background:#ccc;top:0;z-index:4;opacity:0.95;left:0;right:0;margin:auto;" class="hideImgTop"></div>';
html += '<div style="position:absolute;background:#ccc;bottom:0;z-index:4;opacity:0.95;left:0;right:0;margin:auto;" class="hideImgBottom"></div>';
html += '<div style="position:absolute;height:100%;background:#ccc;left:0;z-index:4;opacity:0.95;" class="hideImgLeft"></div><div style="position:absolute;z-index:3;left:0;right:0;top:0;bottom:0;margin:auto;" class="cutDiv"></div>';
html += '<div style="position:absolute;height:100%;background:#ccc;right:0;z-index:4;opacity:0.95;" class="hideImgRight"></div>';
html += '<img style="position:absolute;z-index:1;width:'+showImgWidth+'px" onload="showCutImg(this)" class="cutImg" class="imgshover" src="'+objUrl[i]+'" alt="图片加载失败" />';
html += '</div>'; //修改img标签的width样式可改变预览图大小
}
$(this).siblings('.showImgDiv').html(html);
}
//$('.fullDiv').css('float','left');
}
}) ;
//建立一個可存取到該file的url
function getObjectURL1(file) {
var url = null ;
if (window.createObjectURL!=undefined) { // basic
url = window.createObjectURL(file) ;
} else if (window.URL!=undefined) { // mozilla(firefox)
url = window.URL.createObjectURL(file) ;
} else if (window.webkitURL!=undefined) { // webkit or chrome
url = window.webkitURL.createObjectURL(file) ;
}
return url ;
}
//建立一個可存取到該file的url
function getObjectURL2(file) {
var url = new Array();
if (window.createObjectURL!=undefined) { // basic
for(var i=0;i<file.length;i++)
{
url[i] = window.createObjectURL(file[i]) ;
}
} else if (window.URL!=undefined) { // mozilla(firefox)
for(var i=0;i<file.length;i++)
{
url[i] = window.URL.createObjectURL(file[i]) ;










