$(".file").click(function () {
$(".file").on("change",function(){
var objUrl = getObjectURL(this.files[0]) ;
if (objUrl) {
$(".pic").attr("src", objUrl).removeClass("hide");
}
});
});
//存取file的url函数
function getObjectURL(file) {
var url = null ;
if (window.createObjectURL!=undefined) {
url = window.createObjectURL(file) ;
} else if (window.URL!=undefined) {
url = window.URL.createObjectURL(file) ;
} else if (window.webkitURL!=undefined) {
url = window.webkitURL.createObjectURL(file) ;
}
return url ;
}