Commits

Sumin Byeon committed 44477e2

Multiple cover images.

  • Participants
  • Parent commits a7d7bd4

Comments (0)

Files changed (4)

File cover.jpg

Removed
Old image

File cover1.jpg

Added
New image

File cover2.png

Added
New image
+
+var coverImages = new Array("cover1.jpg", "cover2.png");
+var currentPage = 0;
+var numberOfPages = coverImages.length;
+
+function nextPage() {
+    currentPage = (currentPage + 1) % numberOfPages;
+    goToPage(currentPage);
+}
+
+function goToPage(page) {
+    currentPage = page;
+    $("#cover").attr("src", coverImages[currentPage]);
+    $(".dot").removeClass("current");
+    $("#dot" + (page+1)).addClass("current");
+}
+
+window.onload = function() {
+    $("#cover").click(nextPage);
+    for (var i = 0; i < numberOfPages; i++) {
+        $("#dot" + (i+1)).click(function() { goToPage(i); });
+    }
+}