index.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <html>
  2. <head>
  3. <title>Image Gallery</title>
  4. <link rel="stylesheet" type="text/css" href="/css/bootstrap.css" />
  5. <link rel="stylesheet" type="text/css" href="/css/styles.css" />
  6. <script type="text/ecmascript" src="/lib/jquery-2.2.1.js"></script>
  7. </head>
  8. <body>
  9. <!-- some header info (from Matthew's code) -->
  10. <a href="index.html">Home</a>
  11. &nbsp;
  12. <a href="aboutme.html">About me</a>
  13. &nbsp;
  14. <a href="contact.html">Contact me</a>
  15. <hr />
  16. <div class="container">
  17. <h1>Image Gallery</h1>
  18. <!--
  19. These are the thumbnail images. They are laid out using the bootstrap
  20. grid. I have given them all the class "crop-image" which I use in the
  21. css and the javascript code.
  22. -->
  23. <div class="row">
  24. <div class="col-md-3">
  25. <img class="crop-img"
  26. src="/images/img_1.jpg"
  27. alt="graffittied building"/>
  28. </div>
  29. <div class="col-md-3">
  30. <img class="crop-img"
  31. src="/images/img_3.jpg"
  32. alt="display of cheese"/>
  33. </div>
  34. <div class="col-md-3">
  35. <img class="crop-img"
  36. src="/images/img_4.jpg"
  37. alt="synethesizer workshop"/>
  38. </div>
  39. <div class="col-md-3">
  40. <img class="crop-img"
  41. src="/images/img_5.jpg"
  42. alt="City night"/>
  43. </div>
  44. </div>
  45. <!--
  46. this is the large image which is
  47. on a row of its own.
  48. I will change it source in the
  49. javascript
  50. -->
  51. <div class="row">
  52. <div class="col-md-12">
  53. <img id="bigImage"
  54. class="large-img"
  55. src="/images/img_1.jpg"
  56. alt="graffittied building"/>
  57. </div>
  58. </div>
  59. </div>
  60. <script>
  61. // when we click on the thumbnail
  62. // we set the src attribute of the
  63. // bit image to be the same as the
  64. // src of the image we have clicked on
  65. // ("this"). This loads the same
  66. // image file into the big image
  67. $(".crop-img").click(function(){
  68. $("#bigImage").attr('src',
  69. $(this).attr('src'));
  70. });
  71. </script>
  72. </body>
  73. </html>