You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<!DOCTYPE html> |
|
|
<html lang="en"> |
|
|
<head> |
|
|
<meta charset="utf-8"> |
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|
|
<title>Login Form</title> |
|
|
<link rel="stylesheet" href="css/style.css"> |
|
|
<link rel="shortcut icon" type="image/png" href="https://avatars1.githubusercontent.com/u/17867603?v=3&s=200"/> |
|
|
<script src="js/jquery-3.0.0.min.js"></script> |
|
|
<script src="js/dropzone.js"></script> |
|
|
|
|
|
<style> |
|
|
.image { |
|
|
position: relative; |
|
|
width: 400px; /* for IE 6 */ |
|
|
} |
|
|
|
|
|
h2 { |
|
|
position: absolute; |
|
|
top: 200px; |
|
|
left: 0; |
|
|
width: 100%; |
|
|
} |
|
|
img{ |
|
|
width: 400px; |
|
|
height: 400px; |
|
|
} |
|
|
|
|
|
.flexCenter { |
|
|
display:flex; |
|
|
justify-content: center; |
|
|
align-items:center; |
|
|
} |
|
|
.cardData{ |
|
|
display:flex; |
|
|
justify-content: center; |
|
|
align-items:center; |
|
|
margin-top: 10px; |
|
|
margin: 10px; |
|
|
background-color: #FFF; |
|
|
width: 150px; |
|
|
height: 150px; |
|
|
border: 1px solid navy; |
|
|
|
|
|
} |
|
|
div.upload { |
|
|
position: absolute; |
|
|
border-radius: 5px; |
|
|
width: 100px; |
|
|
height: 50px; |
|
|
background-color: #FFF; |
|
|
color: #000; |
|
|
overflow: hidden; |
|
|
} |
|
|
|
|
|
div input { |
|
|
position: absolute; |
|
|
border-radius: 5px; |
|
|
display: block !important; |
|
|
width: 100px !important; |
|
|
height: 50px !important; |
|
|
opacity: 0 !important; |
|
|
overflow: hidden !important; |
|
|
} |
|
|
|
|
|
</style> |
|
|
|
|
|
</head> |
|
|
<body> |
|
|
|
|
|
<div class="flexCenter"> |
|
|
<div class="image flexCenter"> |
|
|
<img id="myImg" src="" alt="" /> |
|
|
<center><h2>ไม่มีรูปภาพ</h2> </center> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flexCenter"> |
|
|
<div class="upload flexCenter"> |
|
|
<a style="font-size:18px">Upload</a> |
|
|
</div> |
|
|
<input type="file" name="upload"/> |
|
|
</div> |
|
|
|
|
|
|
|
|
</body> |
|
|
|
|
|
<script> |
|
|
$(function () { |
|
|
$(":file").change(function () { |
|
|
if (this.files && this.files[0]) { |
|
|
var reader = new FileReader(); |
|
|
reader.onload = imageIsLoaded; |
|
|
reader.readAsDataURL(this.files[0]); |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
function imageIsLoaded(e) { |
|
|
$('#myImg').attr('src', e.target.result); |
|
|
}; |
|
|
|
|
|
</script> |
|
|
|
|
|
</html>
|
|
|
|