summary refs log tree commit diff
path: root/js/now.js
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2017-12-11 08:47:20 -0500
committerBen Harris <ben@tilde.team>2017-12-11 08:47:20 -0500
commit20a195e90838630d406799582095cadd2e4ca13f (patch)
tree1f8dcfc96b4d99dbdde5cac5e802eaf0a6f0b8e0 /js/now.js
init
Diffstat (limited to 'js/now.js')
-rw-r--r--js/now.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/js/now.js b/js/now.js
new file mode 100644
index 0000000..fd6a01b
--- /dev/null
+++ b/js/now.js
@@ -0,0 +1,60 @@
+/*-----------------------------------------------------------------------------------

+/*

+/* Now JS

+/*

+-----------------------------------------------------------------------------------*/

+

+ jQuery(document).ready(function($) {

+

+/*----------------------------------------------------*/

+/* FitText Settings

+------------------------------------------------------ */

+

+    setTimeout(function() {

+        $('h1.responsive-headline').fitText(1, { minFontSize: '40px', maxFontSize: '90px' });

+    }, 100);

+

+

+/*----------------------------------------------------*/

+/*	Make sure that #header-background-image height is

+/* equal to the browser height.

+------------------------------------------------------ */

+

+   $(window).on('resize', function() {

+        $('body').css({ 'width': $(window).width() })

+   });

+

+

+/*----------------------------------------------------*/

+/*	Fade In/Out Primary Navigation

+------------------------------------------------------*/

+

+   $(window).on('scroll', function() {

+

+		var h = $('header').height();

+		var y = $(window).scrollTop();

+        var nav = $('#nav-wrap');

+

+        if ( (y > h*.20) && (y < h) && ($(window).outerWidth() > 768 ) ) {

+            nav.fadeOut('fast');

+        }

+        else {

+            if (y < h*.20) {

+                nav.removeClass('opaque').fadeIn('fast');

+            }

+            else {

+                nav.addClass('opaque').fadeIn('fast');

+            }

+        }

+

+	});

+

+

+});

+

+

+

+

+

+

+