Advertisement
Guest User

Image

a guest
May 30th, 2012
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
  2. <script type="text/javascript">
  3. function imageURL(input) {
  4. if (input.files && input.files[0]) {
  5. var reader = new FileReader();
  6. reader.onload = function(e) {
  7. $('#preview_img').attr('src', e.target.result)
  8. .width('100px')
  9. .height('100px');
  10. }
  11. reader.readAsDataURL(input.files[0]);
  12. }
  13. }
  14. </script>
  15. </head>
  16. <body>
  17. <input type="file" class="file" onchange="imageURL(this)" />
  18. <input type="file" class="file" onchange="imageURL(this)" />
  19. <input type="file" class="file" onchange="imageURL(this)" />
  20. <img id="preview_img" style="width:250px; height:250px;" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement