pour diminuer le header après scroll

This commit is contained in:
Pierre 2020-01-22 03:50:43 +01:00
parent 3cd0afc7ff
commit 750c668c9d
4 changed files with 54 additions and 7 deletions

View file

@ -32,10 +32,21 @@ a, a:hover {
#menu-principal{
padding: 1rem 2rem;
background-color: $fond-menu;
a{
transition: all 1s;
.nav-link{
color: $light;
font-weight: 600;
transition: all 1s ease;
}
.navbar-brand{
width: 200px;
transition: all 1s ease;
img{
width: 100%;
height: auto;
transition: all 1s ease;
}
}
.active a{
color: $page-active;
}
@ -46,10 +57,17 @@ a, a:hover {
font-size: 1.8rem;
color: $light;
}
&.reduit{
padding: 0.2rem 2rem;
.nav-link{
padding: 0.2rem 0.5rem;
}
.navbar-brand{
width: 150px;
}
}
}
#liste-deroulante ul{
list-style-type: none;
}

View file

@ -11860,11 +11860,28 @@ a, a:hover {
#menu-principal {
padding: 1rem 2rem;
background-color: #3b3f8a;
-webkit-transition: all 1s;
transition: all 1s;
}
#menu-principal a {
#menu-principal .nav-link {
color: #f8f9fa;
font-weight: 600;
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
#menu-principal .navbar-brand {
width: 200px;
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
#menu-principal .navbar-brand img {
width: 100%;
height: auto;
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
#menu-principal .active a {
@ -11880,6 +11897,18 @@ a, a:hover {
color: #f8f9fa;
}
#menu-principal.reduit {
padding: 0.2rem 2rem;
}
#menu-principal.reduit .nav-link {
padding: 0.2rem 0.5rem;
}
#menu-principal.reduit .navbar-brand {
width: 150px;
}
#liste-deroulante ul {
list-style-type: none;
}

View file

@ -47,11 +47,11 @@ jQuery(function($) {
var barnavOffset = 0;
$(window).on('scroll', function () {
if ( $(window).scrollTop() > barnavOffset ) {
$('header').addClass('navbar-fixed-reduite');
$('#menu-principal').addClass('reduit');
//$('button.burgermenu, #barnav ul.js-sous-menu').addClass('fixed-top');
}
else {
$('header').removeClass('navbar-fixed-reduite');
$('#menu-principal').removeClass('reduit');
//$('button.burgermenu, #barnav ul.js-sous-menu').removeClass('fixed-top');
}
});

2
js/mon_site.min.js vendored
View file

@ -1,2 +1,2 @@
"use strict";jQuery(function(t){t(".parent_prev_next").on("click","svg.cursor",function(){var e=t(this).data("id_article"),n=t(this).data("bloc_recharger");ajaxReload(n,{args:{id_article:e}})}),t("a.page-scroll").bind("click",function(e){t(this);t("html, body").animate({scrollTop:0},"slow"),e.preventDefault()});t(window).on("scroll",function(){0<t(window).scrollTop()?t("header").addClass("navbar-fixed-reduite"):t("header").removeClass("navbar-fixed-reduite")}),window.addEventListener("resize",function(){document.getElementById("result"),"matchMedia"in window&&(window.matchMedia("(min-width:768px)").matches?(t("#header").removeClass("navbar-fixed-top"),t("button.burgermenu, #barnav ul.js-sous-menu").removeClass("fixed-top")):(t("#header").addClass("navbar-fixed-top"),t("button.burgermenu, #barnav ul.js-sous-menu").addClass("fixed-top")))},!1)}),jQuery(function(t){var n,a;t(".js-sous-menu ul").addClass("js-hidden"),t(".js-sous-menu").on("click","a",function(e){e.stopPropagation();var n=t(this).next();if(n.length)return t(n).toggleClass("js-hidden"),!1}),"querySelector"in document&&"addEventListener"in window&&(window.document.documentElement.className+=" js-enabled",n=document.querySelector(".nav-button"),a=document.querySelector("#barnav"),n&&n.addEventListener("click",function(e){n.classList.toggle("is-active"),a.classList.toggle("is-opened"),e.preventDefault()},!1))});
"use strict";jQuery(function(t){t(".parent_prev_next").on("click","svg.cursor",function(){var e=t(this).data("id_article"),n=t(this).data("bloc_recharger");ajaxReload(n,{args:{id_article:e}})}),t("a.page-scroll").bind("click",function(e){t(this);t("html, body").animate({scrollTop:0},"slow"),e.preventDefault()});t(window).on("scroll",function(){0<t(window).scrollTop()?t("#menu-principal").addClass("reduit"):t("#menu-principal").removeClass("reduit")}),window.addEventListener("resize",function(){document.getElementById("result"),"matchMedia"in window&&(window.matchMedia("(min-width:768px)").matches?(t("#header").removeClass("navbar-fixed-top"),t("button.burgermenu, #barnav ul.js-sous-menu").removeClass("fixed-top")):(t("#header").addClass("navbar-fixed-top"),t("button.burgermenu, #barnav ul.js-sous-menu").addClass("fixed-top")))},!1)}),jQuery(function(t){var n,a;t(".js-sous-menu ul").addClass("js-hidden"),t(".js-sous-menu").on("click","a",function(e){e.stopPropagation();var n=t(this).next();if(n.length)return t(n).toggleClass("js-hidden"),!1}),"querySelector"in document&&"addEventListener"in window&&(window.document.documentElement.className+=" js-enabled",n=document.querySelector(".nav-button"),a=document.querySelector("#barnav"),n&&n.addEventListener("click",function(e){n.classList.toggle("is-active"),a.classList.toggle("is-opened"),e.preventDefault()},!1))});
//# sourceMappingURL=mon_site.min.js.map