initialise listeners in JS, set heights at runtime, add readme
[simple-slideshow.git] / slideshow.html
index a581b1f9e85ec2a7ebccfbe2eb4f10e07b586fd3..88964561d2f7f110e77e7f43cc82d715706c5188 100644 (file)
@@ -6,31 +6,34 @@
 
   <body>
 
-    <div class="slideshow" onmouseenter="mouseEnter()" onmouseleave="mouseLeave()">
+    <div class="slideshow">
+      <div class="slides">
 
-      <figure class="slide">
-        <img src="test-img/1.jpg">
-        <figcaption><span>This is a long caption yeah yeah yeah</figcaption>
-      </figure>
+        <figure class="slide">
+          <img src="test-img/1.jpg">
+          <figcaption>This is a caption</figcaption>
+        </figure>
 
-      <figure class="slide">
-        <img src="test-img/2.jpg">
-        <figcaption><span>Shorter caption</figcaption>
-      </figure>
+        <figure class="slide">
+          <img src="test-img/2.jpg">
+          <figcaption><span>This is a long caption which will probably span over multiple lines (depending on the width of the slideshow). You will see that that the height of the image adjusts to accommodate the taller caption.</figcaption>
+        </figure>
 
-      <figure class="slide">
-        <img src="test-img/3.jpg">
-        <figcaption><span>Caption 3</figcaption>
-      </figure>
+        <figure class="slide">
+          <img src="test-img/3.jpg">
+          <figcaption>Caption 3</figcaption>
+        </figure>
 
-      <a id="prev" onclick="prevSlide()">&#10094;</a>
-      <a id="next" onclick="nextSlide()">&#10095;</a>
-      <a id="state" onclick="changeState()">&#x23f8;&#xFE0E;</a>
+      </div>
+
+      <a id="prev">&#10094;</a>
+      <a id="next">&#10095;</a>
+      <a id="state">&#x23f8;&#xFE0E;</a>
 
       <div id="controls">
-        <span class="dot" onclick="setSlide(0)"></span>
-        <span class="dot" onclick="setSlide(1)"></span>
-        <span class="dot" onclick="setSlide(2)"></span>
+        <span class="dot"></span>
+        <span class="dot"></span>
+        <span class="dot"></span>
       </div>
 
     </div>