Update the script for changes web cam images
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 1 Feb 2016 21:27:21 +0000 (16:27 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 1 Feb 2016 21:34:53 +0000 (16:34 -0500)
using setInterval now

js/app.js
js/custom/pageSetup.js

index 792635b..dba7d86 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -99,15 +99,13 @@ $(document).ready(function () {
             $(this).parent("li").addClass("current");
         }
     });
-    function glmReloadImg() {
+    setInterval(function(){
         $('#cam1').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoNWCam.jpg?b=' + Math.random());
         $('#cam2').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoNECam.jpg?i=' + Math.random());
         $('#cam3').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoAirCam.jpg?b=' + Math.random());
         $('#cam4').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoAnimalCam.jpg?b=' + Math.random());
         $('#cam5').attr('src','http://www.weather.gov/images/apx/webcam/webcam.jpg?b=' + Math.random());
-        setTimeout(glmReloadImg().bind(this), 10000);
-    }
-    glmReloadImg();
+    }, 10000);
 
    /* get number of elements in DOM console.log($("*").length);
     var pageBytes = $('html').html().length;
index 548740b..2a95c8a 100644 (file)
@@ -90,15 +90,13 @@ $(document).ready(function () {
             $(this).parent("li").addClass("current");
         }
     });
-    function glmReloadImg() {
+    setInterval(function(){
         $('#cam1').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoNWCam.jpg?b=' + Math.random());
         $('#cam2').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoNECam.jpg?i=' + Math.random());
         $('#cam3').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoAirCam.jpg?b=' + Math.random());
         $('#cam4').attr('src','http://www.otsegocountymi.gov/images/OtsegoCoAnimalCam.jpg?b=' + Math.random());
         $('#cam5').attr('src','http://www.weather.gov/images/apx/webcam/webcam.jpg?b=' + Math.random());
-        setTimeout(glmReloadImg().bind(this), 10000);
-    }
-    glmReloadImg();
+    }, 10000);
 
    /* get number of elements in DOM console.log($("*").length);
     var pageBytes = $('html').html().length;