Last active
August 29, 2015 13:57
-
-
Save kuwalab/9599110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>ファイルのアイコン表示</title> | |
<link rel="stylesheet" href="../css/fileTypeIcon.css"> | |
</head> | |
<body> | |
<h1>ファイルのアイコン表示</h1> | |
<div><input type="file" id="file"></div> | |
<div id="view"></div> | |
<script src="../bower_components/jquery/dist/jquery.min.js"></script> | |
<script src="../dest/jquery.fileTypeIcon.min.js"></script> | |
<script> | |
$view = $('#view'); | |
$('#file').on('change', function() { | |
var files = $(this).get(0).files; | |
// 複数選択はしない | |
var file = files[0]; | |
$view.fileTypeIcon({ file: file, imageDir: '../image/' }); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment