Making footer nav always stay at bottom of screen, rather than jump to position.
authorLaury GvR <laury@gaslightmedia.com>
Thu, 5 Nov 2015 15:06:42 +0000 (10:06 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 5 Nov 2015 15:06:42 +0000 (10:06 -0500)
css/app.css
js/app.js
js/custom/sticky-footer.js
scss/_structure.scss

index 0c184c9..92aa3db 100644 (file)
@@ -6855,7 +6855,7 @@ footer {
           background-color: #0099cc; }
 
 #copyright {
-  padding: 20px 10px;
+  padding: 20px 10px 50px;
   margin: 0 auto;
   float: none; }
   #copyright p {
index c5a3aa8..e005744 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -19,47 +19,48 @@ $(document).ready(function () {
     });
 });
 ;
-// Set footer position on scroll
-$(window).on('scroll', function () {
-  if ($(window).width() > 640) {
-    setTimeout(function(){ // Slight delay to avoid a jumpy transition
-      $('#connect').css({'position' : get_footer_position});
-    }, 200);
-  }  
-});
+//// Set footer position on scroll
+//$(window).on('scroll', function () {
+//  if ($(window).width() > 640) {
+//    setTimeout(function(){ // Slight delay to avoid a jumpy transition
+//      $('#connect').css({'position' : get_footer_position});
+//    }, 200);
+//  }  
+//});
 
 // Set footer position on load
-$(function() {
-  var position = get_footer_position();
-  $('#connect').css({'position' : position});
-});
-
-function get_footer_position() {
-  if ($(window).width() < 640) {
-      $("#connect").css('padding-bottom','53px');
-    return 'relative';
-  }
-  var footer = $("#copyright");
-  var height_of_footer = footer.height() + -50;
-  var top_of_footer = footer.position().top;
-  // Account for fixed header and padding on the sticky-footer container
-  var fixed_header_height = $('.top-bar-container').height() - 20;
-
-  var top = $(window).scrollTop();
-  var bottom = top + $(window).height() - fixed_header_height;
-
-  if (top_of_footer < $(window).height()) {
-      $("#connect").css('padding-bottom','53px');
-    return 'fixed';
-  }
-  else if (bottom >= top_of_footer) {
-      $("#connect").css('padding-bottom','53px');
-    return 'relative';
-  }
-  else if (bottom <= top_of_footer) {
-      $("#connect").css('padding-bottom','0');
-    return 'fixed';
-  }
+//$(function() {
+//  var position = get_footer_position();
+//  $('#connect').css({'position' : position});
+//});
+//
+//function get_footer_position() {
+//    return 'fixed';
+//  if ($(window).width() < 640) {
+//      $("#connect").css('padding-bottom','53px');
+//    return 'relative';
+//  }
+//  var footer = $("#copyright");
+//  var height_of_footer = footer.height() + -50;
+//  var top_of_footer = footer.position().top;
+//  // Account for fixed header and padding on the sticky-footer container
+//  var fixed_header_height = $('.top-bar-container').height() - 20;
+//
+//  var top = $(window).scrollTop();
+//  var bottom = top + $(window).height() - fixed_header_height;
+//
+//  if (top_of_footer < $(window).height()) {
+//      $("#connect").css('padding-bottom','53px');
+//    return 'fixed';
+//  }
+//  else if (bottom >= top_of_footer) {
+//      $("#connect").css('padding-bottom','53px');
+//    return 'relative';
+//  }
+//  else if (bottom <= top_of_footer) {
+//      $("#connect").css('padding-bottom','0');
+//    return 'fixed';
+//  }
   
 //  function remove_the_arrow() {
 //      $('.sticky-footer-wrapper-class:after').css('border-width', '0');
index 1b0907f..42a58f3 100644 (file)
@@ -1,45 +1,46 @@
 
-// Set footer position on scroll
-$(window).on('scroll', function () {
-  if ($(window).width() > 640) {
-    setTimeout(function(){ // Slight delay to avoid a jumpy transition
-      $('#connect').css({'position' : get_footer_position});
-    }, 200);
-  }  
-});
+//// Set footer position on scroll
+//$(window).on('scroll', function () {
+//  if ($(window).width() > 640) {
+//    setTimeout(function(){ // Slight delay to avoid a jumpy transition
+//      $('#connect').css({'position' : get_footer_position});
+//    }, 200);
+//  }  
+//});
 
 // Set footer position on load
-$(function() {
-  var position = get_footer_position();
-  $('#connect').css({'position' : position});
-});
-
-function get_footer_position() {
-  if ($(window).width() < 640) {
-      $("#connect").css('padding-bottom','53px');
-    return 'relative';
-  }
-  var footer = $("#copyright");
-  var height_of_footer = footer.height() + -50;
-  var top_of_footer = footer.position().top;
-  // Account for fixed header and padding on the sticky-footer container
-  var fixed_header_height = $('.top-bar-container').height() - 20;
-
-  var top = $(window).scrollTop();
-  var bottom = top + $(window).height() - fixed_header_height;
-
-  if (top_of_footer < $(window).height()) {
-      $("#connect").css('padding-bottom','53px');
-    return 'fixed';
-  }
-  else if (bottom >= top_of_footer) {
-      $("#connect").css('padding-bottom','53px');
-    return 'relative';
-  }
-  else if (bottom <= top_of_footer) {
-      $("#connect").css('padding-bottom','0');
-    return 'fixed';
-  }
+//$(function() {
+//  var position = get_footer_position();
+//  $('#connect').css({'position' : position});
+//});
+//
+//function get_footer_position() {
+//    return 'fixed';
+//  if ($(window).width() < 640) {
+//      $("#connect").css('padding-bottom','53px');
+//    return 'relative';
+//  }
+//  var footer = $("#copyright");
+//  var height_of_footer = footer.height() + -50;
+//  var top_of_footer = footer.position().top;
+//  // Account for fixed header and padding on the sticky-footer container
+//  var fixed_header_height = $('.top-bar-container').height() - 20;
+//
+//  var top = $(window).scrollTop();
+//  var bottom = top + $(window).height() - fixed_header_height;
+//
+//  if (top_of_footer < $(window).height()) {
+//      $("#connect").css('padding-bottom','53px');
+//    return 'fixed';
+//  }
+//  else if (bottom >= top_of_footer) {
+//      $("#connect").css('padding-bottom','53px');
+//    return 'relative';
+//  }
+//  else if (bottom <= top_of_footer) {
+//      $("#connect").css('padding-bottom','0');
+//    return 'fixed';
+//  }
   
 //  function remove_the_arrow() {
 //      $('.sticky-footer-wrapper-class:after').css('border-width', '0');
index 7eff019..673cbcd 100644 (file)
@@ -1206,7 +1206,7 @@ footer {
 
 //12. Copyright
 #copyright {
-    padding: 20px 10px;
+    padding: 20px 10px 50px;
     margin: 0 auto;
     float: none;
     p {