Avatar now fades with jQuery (#293) (#295)

This commit is contained in:
Alexander Filatov 2018-01-03 07:58:51 +01:00 committed by Dean Attali
parent 92c9cf8e4b
commit 7bc3cb20ea
2 changed files with 21 additions and 27 deletions

View File

@ -172,11 +172,7 @@ img {
} }
.navbar-custom .avatar-container { .navbar-custom .avatar-container {
opacity: 1;
position: absolute; position: absolute;
-webkit-transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
left: 50%; left: 50%;
width: 50px; width: 50px;
margin-top: -25px; margin-top: -25px;
@ -196,10 +192,6 @@ img {
display: block; display: block;
} }
.navbar-custom.top-nav-short .avatar-container{
opacity: 0;
}
.navbar-custom.top-nav-expanded .avatar-container { .navbar-custom.top-nav-expanded .avatar-container {
display: none; display: none;
} }

View File

@ -10,8 +10,10 @@ var main = {
$(window).scroll(function() { $(window).scroll(function() {
if ($(".navbar").offset().top > 50) { if ($(".navbar").offset().top > 50) {
$(".navbar").addClass("top-nav-short"); $(".navbar").addClass("top-nav-short");
$(".navbar-custom .avatar-container").fadeOut(500);
} else { } else {
$(".navbar").removeClass("top-nav-short"); $(".navbar").removeClass("top-nav-short");
$(".navbar-custom .avatar-container").fadeIn(500);
} }
}); });