issue56, play and pause of autobrowsing is now possible
[phpfspot.git] / phpfspot.js
index 588298ab3691f53755d013e34bdf31aadcfa73b5..6bc0d2c96be4857ad1c8859a6286c832f640a1fb 100644 (file)
@@ -313,12 +313,25 @@ function nextSlide()
    document.getElementById('slide_img').src = next_img;
 }
 
+function startAutoBrowse()
+{
+   if(!autobrowse) {
+      autoBrowse();
+      autobrowse = setInterval("autoBrowse()", 5000);
+   }
+   else {
+      clearInterval(autobrowse);
+      autobrowse = 0;
+      document.getElementById('autobrowse_ico').src = "resources/32_play.png";
+   }
+
+}
 function autoBrowse()
 {
    if(document.getElementById('next_link')) {
       var next_link = document.getElementById('next_link').href;
       window.location.href = next_link;
-      setTimeout("autoBrowse()", 5000);
+      document.getElementById('autobrowse_ico').src = "resources/32_pause.png";
    }
 }