From: Steve Sutton Date: Mon, 1 Feb 2016 21:27:21 +0000 (-0500) Subject: Update the script for changes web cam images X-Git-Tag: v1.0.0^2~5 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=17760638f6b237761435b26164003da07c48a958;p=WP-Themes%2Fotsego.git Update the script for changes web cam images using setInterval now --- 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;