From c9df94a4c3553eda68a6f9611553eb4621f5aa85 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 1 Feb 2016 15:58:15 -0500 Subject: [PATCH] Update js file with the web cam image updates remove from page and place in js file --- js/app.js | 33 +++++++++++++++------------------ js/custom/pageSetup.js | 33 +++++++++++++++------------------ 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/js/app.js b/js/app.js index b7df57b..190a2a8 100644 --- 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(''); -// } 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 $("

", {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); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 8989f93..8d895e8 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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(''); -// } 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 $("

", {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); }); -- 2.17.1