From 17760638f6b237761435b26164003da07c48a958 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 1 Feb 2016 16:27:21 -0500 Subject: [PATCH] Update the script for changes web cam images using setInterval now --- js/app.js | 6 ++---- js/custom/pageSetup.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/js/app.js b/js/app.js index 792635b..dba7d86 100644 --- 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; diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 548740b..2a95c8a 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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; -- 2.17.1