From: Anthony Talarico Date: Wed, 7 Jun 2017 16:39:46 +0000 (-0400) Subject: removing javascript out of the pageSetup and into template to mount on dev55 for... X-Git-Tag: v1.0.0^2~38^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=1db52d0729c4aa83074c6bc64d2b1051b50125fc;p=WP-Themes%2Fgaylordmichigan.git removing javascript out of the pageSetup and into template to mount on dev55 for direct testing moving into the frontpage template --- diff --git a/js/app.js b/js/app.js index 4013c6a..53d4804 100644 --- a/js/app.js +++ b/js/app.js @@ -263,58 +263,57 @@ $(document).ready(function () { // window.addEventListener('scroll', checkScroll, false); // window.addEventListener('resize', checkScroll, false); //}) - $.fn.isOnScreen = function(){ - - var win = $(window); - - var viewport = { - top : win.scrollTop(), - left : win.scrollLeft() - }; - viewport.right = viewport.left + win.width(); - viewport.bottom = viewport.top + win.height(); - - var bounds = this.offset(); - bounds.right = bounds.left + this.outerWidth(); - bounds.bottom = bounds.top + this.outerHeight(); - - return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); - - }; - $(window).on("load", function(){ - var video_visible = $("#wp-custom-header").isOnScreen(); - var clicked = false; - var paused; - - if(!video_visible){ - $("#wp-custom-header-video-button").trigger('click'); - paused = true; - console.log("PAUSED"); - } else { - paused = false; - console.log('PLAYING'); - } - - $(window).on("scroll", function(){ - console.log(clicked, paused, video_visible); - - video_visible = $("#wp-custom-header").isOnScreen(); - - if(video_visible && clicked === false && paused === true){ - $("#wp-custom-header-video-button").trigger('click'); - clicked = true; - paused = false; - console.log('PLAY'); - } - else if(!video_visible && paused === false ){ - paused = true; - $("#wp-custom-header-video-button").trigger('click'); - clicked = false; - console.log( "PAUSE"); - } else { - console.log("Nothing is happening"); - } - }) - }); - +// $.fn.isOnScreen = function(){ +// +// var win = $(window); +// +// var viewport = { +// top : win.scrollTop(), +// left : win.scrollLeft() +// }; +// viewport.right = viewport.left + win.width(); +// viewport.bottom = viewport.top + win.height(); +// +// var bounds = this.offset(); +// bounds.right = bounds.left + this.outerWidth(); +// bounds.bottom = bounds.top + this.outerHeight(); +// +// return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); +// +// }; +// $(window).on("load", function(){ +// var video_visible = $("#wp-custom-header").isOnScreen(); +// var clicked = false; +// var paused; +// +// if(!video_visible){ +// $("#wp-custom-header-video-button").trigger('click'); +// paused = true; +// console.log("PAUSED"); +// } else { +// paused = false; +// console.log('PLAYING'); +// } +// +// $(window).on("scroll", function(){ +// console.log(clicked, paused, video_visible); +// +// video_visible = $("#wp-custom-header").isOnScreen(); +// +// if(video_visible && clicked === false && paused === true){ +// $("#wp-custom-header-video-button").trigger('click'); +// clicked = true; +// paused = false; +// console.log('PLAY'); +// } +// else if(!video_visible && paused === false ){ +// paused = true; +// $("#wp-custom-header-video-button").trigger('click'); +// clicked = false; +// console.log( "PAUSE"); +// } else { +// console.log("Nothing is happening"); +// } +// }) +// }); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 5b56d99..a04e61a 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -60,58 +60,57 @@ $(document).ready(function () { // window.addEventListener('scroll', checkScroll, false); // window.addEventListener('resize', checkScroll, false); //}) - $.fn.isOnScreen = function(){ - - var win = $(window); - - var viewport = { - top : win.scrollTop(), - left : win.scrollLeft() - }; - viewport.right = viewport.left + win.width(); - viewport.bottom = viewport.top + win.height(); - - var bounds = this.offset(); - bounds.right = bounds.left + this.outerWidth(); - bounds.bottom = bounds.top + this.outerHeight(); - - return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); - - }; - $(window).on("load", function(){ - var video_visible = $("#wp-custom-header").isOnScreen(); - var clicked = false; - var paused; - - if(!video_visible){ - $("#wp-custom-header-video-button").trigger('click'); - paused = true; - console.log("PAUSED"); - } else { - paused = false; - console.log('PLAYING'); - } - - $(window).on("scroll", function(){ - console.log(clicked, paused, video_visible); - - video_visible = $("#wp-custom-header").isOnScreen(); - - if(video_visible && clicked === false && paused === true){ - $("#wp-custom-header-video-button").trigger('click'); - clicked = true; - paused = false; - console.log('PLAY'); - } - else if(!video_visible && paused === false ){ - paused = true; - $("#wp-custom-header-video-button").trigger('click'); - clicked = false; - console.log( "PAUSE"); - } else { - console.log("Nothing is happening"); - } - }) - }); - +// $.fn.isOnScreen = function(){ +// +// var win = $(window); +// +// var viewport = { +// top : win.scrollTop(), +// left : win.scrollLeft() +// }; +// viewport.right = viewport.left + win.width(); +// viewport.bottom = viewport.top + win.height(); +// +// var bounds = this.offset(); +// bounds.right = bounds.left + this.outerWidth(); +// bounds.bottom = bounds.top + this.outerHeight(); +// +// return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); +// +// }; +// $(window).on("load", function(){ +// var video_visible = $("#wp-custom-header").isOnScreen(); +// var clicked = false; +// var paused; +// +// if(!video_visible){ +// $("#wp-custom-header-video-button").trigger('click'); +// paused = true; +// console.log("PAUSED"); +// } else { +// paused = false; +// console.log('PLAYING'); +// } +// +// $(window).on("scroll", function(){ +// console.log(clicked, paused, video_visible); +// +// video_visible = $("#wp-custom-header").isOnScreen(); +// +// if(video_visible && clicked === false && paused === true){ +// $("#wp-custom-header-video-button").trigger('click'); +// clicked = true; +// paused = false; +// console.log('PLAY'); +// } +// else if(!video_visible && paused === false ){ +// paused = true; +// $("#wp-custom-header-video-button").trigger('click'); +// clicked = false; +// console.log( "PAUSE"); +// } else { +// console.log("Nothing is happening"); +// } +// }) +// }); });