Skip to content

Instantly share code, notes, and snippets.

@kuwalab
Last active August 29, 2015 13:57
Show Gist options
  • Save kuwalab/9599110 to your computer and use it in GitHub Desktop.
Save kuwalab/9599110 to your computer and use it in GitHub Desktop.
<!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