-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide menu scrollbar in favor of a shadow as indicator
The menu scrollbar is no longer visible, but a shadow above #header-security acts as indicator if there is still items to scroll.
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
$(function () { | ||
var hnav = document.getElementById('header-nav'); | ||
$(hnav).bind('scroll', dropSidemenuShadow); | ||
$(window).bind('resize', function(){ | ||
dropSidemenuShadow.apply(hnav); | ||
}); | ||
dropSidemenuShadow.apply(hnav); | ||
}); | ||
|
||
function dropSidemenuShadow() { | ||
var $hsec = $("#header-security"); | ||
if(this.scrollHeight === this.clientHeight) { | ||
$hsec.removeClass('drop-shadow'); | ||
return; | ||
} | ||
var scrollPurcent = 100 * this.scrollTop / this.scrollHeight / (1 - this.clientHeight / this.scrollHeight); | ||
isNaN(scrollPurcent) || scrollPurcent >= 100 ? $hsec.removeClass('drop-shadow') : $hsec.addClass('drop-shadow'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters