Hamlet Revised

I wrote this in 2015, but I’ve been trying to knock the rust off my programming skills. This seemed like a good candidate for a slideshow. 

  var i = 0; // Start Point var images = []; // Images Array var time = 9000; // Time Between Switch // Image List images[0] = “https://1.bp.blogspot.com/-HnmBmKVwmfo/XueoPOFpnJI/AAAAAAAAOSA/mq28N3MyaP43kv11F7DpV60Z03g9ayQ1wCK4BGAsYHg/w580/HamletRevised1.png&#8221;; images[1] = “https://1.bp.blogspot.com/-eV8TTmD5C6w/XueoPH1JWcI/AAAAAAAAOSE/BE6Es41v_qUsd9zB7saFfE5rQ54XLW61QCK4BGAsYHg/w500/HamletRevised2.png&#8221;; images[2] = “https://1.bp.blogspot.com/-M4SuhFV7sj4/XueoPYbTouI/AAAAAAAAOSI/Yh7mTG1agZkFAOQfNyaAxOiE_9PCtpRmwCK4BGAsYHg/w500/HamletRevised3.png&#8221;; images[3] = “https://1.bp.blogspot.com/-YhYLV7WQh7M/XueoPgN5cvI/AAAAAAAAOSM/NgN5x2BAj2waBWcGBGsmkaa1D2Jtm2wCACK4BGAsYHg/w500/HamletRevised4.png&#8221;; images[4] = “https://1.bp.blogspot.com/-3gE-BCRDk5c/XueoPgI0TWI/AAAAAAAAOSQ/bOe6IxoQ990l5Qk6eJjiNbYyosW_exQxACK4BGAsYHg/w500/HamletRevised5.png&#8221;; images[5] = “https://1.bp.blogspot.com/-D5SJZptFt2M/XueoP2m94PI/AAAAAAAAOSU/yCTSPjxR8mIfwQQkIVpCIP8iRBWm7fEpQCK4BGAsYHg/w500/HamletRevised6.png&#8221;; images[6] = “https://1.bp.blogspot.com/-CbPS3cLVkws/XueoQLyKM2I/AAAAAAAAOSY/hb_Y_v2wh3ctcd4TCLIXzCLWG871cGjvACK4BGAsYHg/w500/HamletRevised7.png&#8221;; images[7] = “https://1.bp.blogspot.com/-UhSghbtdCS4/XueoQDDdQ2I/AAAAAAAAOSw/T7HZ_CgLiWIJEg8ZsGTW3fmvRVh-FP4vwCK4BGAsYHg/w500/HamletRevised8.png&#8221;; // Change Image function changeImg(){ document.slide.src = images[i]; // Check If Index Is Under Max if(i < images.length – 1){ // Add 1 to Index i++; } else { // Reset Back To O return false; } // Run function every x seconds setTimeout("changeImg()", time); } // Run function when page loads window.onload=changeImg;

Leave a Reply