Update js file with the web cam image updates
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 1 Feb 2016 20:58:15 +0000 (15:58 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 1 Feb 2016 20:58:15 +0000 (15:58 -0500)
remove from page and place in js file

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

index b7df57b..190a2a8 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -18,17 +18,6 @@ $(document).ready(function () {
         $(this).toggleClass('open');
         $(this).siblings('ul').toggleClass('open');
     });
-//    $('.top-bar-section').find('ul.sub-menu.dropdown').each(function (){
-//        var menuImg = $(this).parent('li').prop('id');
-//        var menuNum = menuImg.match(/\d+/)[0];
-//        var menuImgSrc = 'img_for_menu_' + menuNum;
-//        if (window['img_for_menu_' + menuNum]) {
-//            $(this).find('li.image-placeholder').html('<img src="' + eval(menuImgSrc) + '">');
-//        } else {
-//            $(this).find('li.image-placeholder').parent('ul').addClass('no-image-subul');
-//            $(this).find('li.image-placeholder').remove();
-//        }
-//    });
         $("#blog-posts-over").find(".ai1ec-event-footer").remove();
         // Vendor Registration DOB input3_3
         $( "#input_3_3" ).datepicker({
@@ -46,8 +35,8 @@ $(document).ready(function () {
             buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
             buttonImageOnly: true
         });
-    
-    // caching menu elements 
+
+    // caching menu elements
     var $menu1 =  $(".top-bar-section > ul")
         .children("li")
         .eq(0)
@@ -68,7 +57,7 @@ $(document).ready(function () {
         .children("li")
         .eq(5)
         .children("ul.sub-menu.dropdown");
-    
+
     // adjusting nav menu columns and li width
     $menu1
         .css("max-height", "290px")
@@ -100,7 +89,7 @@ $(document).ready(function () {
     $(".side-links").find("h1").replaceWith(function(){
         return $("<h2 />", {html: $(this).html()});
     });
-    
+
     // current page active link highlighting
     $('.side-links ul li a').each(function() {
         if ($(this).prop('href') == window.location.href) {
@@ -110,13 +99,21 @@ $(document).ready(function () {
             $(this).parent("li").addClass("current");
         }
     });
-   
-   
+    function reloadImg() {
+        $('#cam1').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoNECam.jpg?i=' + Math.random());
+        $('#cam2').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoNWCam.jpg?b=' + Math.random());
+        $('#cam3').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoAirCam.jpg?b=' + Math.random());
+        $('#cam4').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoAnimalCam.jpg?b=' + Math.random());
+        $('#cam5').attr('src','http://www.weather.gov/images/apx/webcam/webcam.jpg?b=' + Math.random());
+        setTimeout("reloadImg()", 10000);
+    }
+    reloadImg();
+
    /* get number of elements in DOM console.log($("*").length);
     var pageBytes = $('html').html().length;
     var kbytes = pageBytes / 1024;
     console.log(kbytes); */
-    
+
         //console.log('ul = ' + menuImg);
         //console.log('menu-id = ' + menuNum);
 });
index 8989f93..8d895e8 100644 (file)
@@ -9,17 +9,6 @@ $(document).ready(function () {
         $(this).toggleClass('open');
         $(this).siblings('ul').toggleClass('open');
     });
-//    $('.top-bar-section').find('ul.sub-menu.dropdown').each(function (){
-//        var menuImg = $(this).parent('li').prop('id');
-//        var menuNum = menuImg.match(/\d+/)[0];
-//        var menuImgSrc = 'img_for_menu_' + menuNum;
-//        if (window['img_for_menu_' + menuNum]) {
-//            $(this).find('li.image-placeholder').html('<img src="' + eval(menuImgSrc) + '">');
-//        } else {
-//            $(this).find('li.image-placeholder').parent('ul').addClass('no-image-subul');
-//            $(this).find('li.image-placeholder').remove();
-//        }
-//    });
         $("#blog-posts-over").find(".ai1ec-event-footer").remove();
         // Vendor Registration DOB input3_3
         $( "#input_3_3" ).datepicker({
@@ -37,8 +26,8 @@ $(document).ready(function () {
             buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
             buttonImageOnly: true
         });
-    
-    // caching menu elements 
+
+    // caching menu elements
     var $menu1 =  $(".top-bar-section > ul")
         .children("li")
         .eq(0)
@@ -59,7 +48,7 @@ $(document).ready(function () {
         .children("li")
         .eq(5)
         .children("ul.sub-menu.dropdown");
-    
+
     // adjusting nav menu columns and li width
     $menu1
         .css("max-height", "290px")
@@ -91,7 +80,7 @@ $(document).ready(function () {
     $(".side-links").find("h1").replaceWith(function(){
         return $("<h2 />", {html: $(this).html()});
     });
-    
+
     // current page active link highlighting
     $('.side-links ul li a').each(function() {
         if ($(this).prop('href') == window.location.href) {
@@ -101,13 +90,21 @@ $(document).ready(function () {
             $(this).parent("li").addClass("current");
         }
     });
-   
-   
+    function reloadImg() {
+        $('#cam1').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoNECam.jpg?i=' + Math.random());
+        $('#cam2').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoNWCam.jpg?b=' + Math.random());
+        $('#cam3').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoAirCam.jpg?b=' + Math.random());
+        $('#cam4').attr('src','http://www.otsegocountymi.gov/images/resizedOtsegoCoAnimalCam.jpg?b=' + Math.random());
+        $('#cam5').attr('src','http://www.weather.gov/images/apx/webcam/webcam.jpg?b=' + Math.random());
+        setTimeout("reloadImg()", 10000);
+    }
+    reloadImg();
+
    /* get number of elements in DOM console.log($("*").length);
     var pageBytes = $('html').html().length;
     var kbytes = pageBytes / 1024;
     console.log(kbytes); */
-    
+
         //console.log('ul = ' + menuImg);
         //console.log('menu-id = ' + menuNum);
 });