From a44e0e0478d5493129bf10de6efcc5d66025129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Vilar=C3=B3?= Date: Sun, 26 Jul 2015 14:52:18 +0200 Subject: [PATCH 1/3] Make the hidden navbar transparent --- src/jquery.bootstrap-autohidingnavbar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jquery.bootstrap-autohidingnavbar.js b/src/jquery.bootstrap-autohidingnavbar.js index cef93b8..f95df4a 100644 --- a/src/jquery.bootstrap-autohidingnavbar.js +++ b/src/jquery.bootstrap-autohidingnavbar.js @@ -15,7 +15,7 @@ showOnUpscroll: true, showOnBottom: true, hideOffset: 'auto', // "auto" means the navbar height - animationDuration: 200 + animationDuration: 200, }; function AutoHidingNavbar(element, options) { @@ -32,7 +32,7 @@ } autoHidingNavbar.element.addClass('navbar-hidden').animate({ - top: -autoHidingNavbar.element.height() + top: -autoHidingNavbar.element.height(), }, { queue: false, duration: autoHidingNavbar.settings.animationDuration @@ -49,7 +49,7 @@ } autoHidingNavbar.element.removeClass('navbar-hidden').animate({ - top: 0 + top: 0, }, { queue: false, duration: autoHidingNavbar.settings.animationDuration @@ -135,6 +135,7 @@ this.setShowOnBottom(this.settings.showOnBottom); this.setHideOffset(this.settings.hideOffset); this.setAnimationDuration(this.settings.animationDuration); + this.setMakeTransparent(this.settings.makeTransparent); _hideOffset = this.settings.hideOffset === 'auto' ? this.element.height() : this.settings.hideOffset; bindEvents(this); From 7a5792117d68eb183642f0c52897f34245a0ffc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Vilar=C3=B3?= Date: Sun, 26 Jul 2015 14:59:58 +0200 Subject: [PATCH 2/3] Revert "Make the hidden navbar transparent" This reverts commit a44e0e0478d5493129bf10de6efcc5d66025129b. --- src/jquery.bootstrap-autohidingnavbar.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/jquery.bootstrap-autohidingnavbar.js b/src/jquery.bootstrap-autohidingnavbar.js index f95df4a..cef93b8 100644 --- a/src/jquery.bootstrap-autohidingnavbar.js +++ b/src/jquery.bootstrap-autohidingnavbar.js @@ -15,7 +15,7 @@ showOnUpscroll: true, showOnBottom: true, hideOffset: 'auto', // "auto" means the navbar height - animationDuration: 200, + animationDuration: 200 }; function AutoHidingNavbar(element, options) { @@ -32,7 +32,7 @@ } autoHidingNavbar.element.addClass('navbar-hidden').animate({ - top: -autoHidingNavbar.element.height(), + top: -autoHidingNavbar.element.height() }, { queue: false, duration: autoHidingNavbar.settings.animationDuration @@ -49,7 +49,7 @@ } autoHidingNavbar.element.removeClass('navbar-hidden').animate({ - top: 0, + top: 0 }, { queue: false, duration: autoHidingNavbar.settings.animationDuration @@ -135,7 +135,6 @@ this.setShowOnBottom(this.settings.showOnBottom); this.setHideOffset(this.settings.hideOffset); this.setAnimationDuration(this.settings.animationDuration); - this.setMakeTransparent(this.settings.makeTransparent); _hideOffset = this.settings.hideOffset === 'auto' ? this.element.height() : this.settings.hideOffset; bindEvents(this); From 3eb7816e47934109bf4ed5bd176b01031b50fe85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Vilar=C3=B3?= Date: Sun, 26 Jul 2015 15:00:48 +0200 Subject: [PATCH 3/3] Make the hidden navbar transparent --- src/jquery.bootstrap-autohidingnavbar.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/jquery.bootstrap-autohidingnavbar.js b/src/jquery.bootstrap-autohidingnavbar.js index cef93b8..ecf7929 100644 --- a/src/jquery.bootstrap-autohidingnavbar.js +++ b/src/jquery.bootstrap-autohidingnavbar.js @@ -15,7 +15,8 @@ showOnUpscroll: true, showOnBottom: true, hideOffset: 'auto', // "auto" means the navbar height - animationDuration: 200 + animationDuration: 200, + makeTransparent: false }; function AutoHidingNavbar(element, options) { @@ -32,7 +33,8 @@ } autoHidingNavbar.element.addClass('navbar-hidden').animate({ - top: -autoHidingNavbar.element.height() + top: -autoHidingNavbar.element.height(), + opacity: _finalOpacity }, { queue: false, duration: autoHidingNavbar.settings.animationDuration @@ -49,7 +51,8 @@ } autoHidingNavbar.element.removeClass('navbar-hidden').animate({ - top: 0 + top: 0, + opacity: _initialOpacity }, { queue: false, duration: autoHidingNavbar.settings.animationDuration @@ -135,8 +138,11 @@ this.setShowOnBottom(this.settings.showOnBottom); this.setHideOffset(this.settings.hideOffset); this.setAnimationDuration(this.settings.animationDuration); + this.setMakeTransparent(this.settings.makeTransparent); _hideOffset = this.settings.hideOffset === 'auto' ? this.element.height() : this.settings.hideOffset; + _initialOpacity = this.element.css('opacity'); + _finalOpacity = this.settings.makeTransparent === true ? 0 : _initialOpacity; bindEvents(this); return this.element; @@ -161,6 +167,10 @@ this.settings.animationDuration = value; return this.element; }, + setMakeTransparent: function(value) { + this.settings.makeTransparent = value; + return this.element; + }, show: function() { show(this); return this.element;