pour diminuer le header après scroll
This commit is contained in:
parent
3cd0afc7ff
commit
750c668c9d
4 changed files with 54 additions and 7 deletions
|
@ -32,10 +32,21 @@ a, a:hover {
|
||||||
#menu-principal{
|
#menu-principal{
|
||||||
padding: 1rem 2rem;
|
padding: 1rem 2rem;
|
||||||
background-color: $fond-menu;
|
background-color: $fond-menu;
|
||||||
a{
|
transition: all 1s;
|
||||||
|
.nav-link{
|
||||||
color: $light;
|
color: $light;
|
||||||
font-weight: 600;
|
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{
|
.active a{
|
||||||
color: $page-active;
|
color: $page-active;
|
||||||
}
|
}
|
||||||
|
@ -46,10 +57,17 @@ a, a:hover {
|
||||||
font-size: 1.8rem;
|
font-size: 1.8rem;
|
||||||
color: $light;
|
color: $light;
|
||||||
}
|
}
|
||||||
|
&.reduit{
|
||||||
|
padding: 0.2rem 2rem;
|
||||||
|
.nav-link{
|
||||||
|
padding: 0.2rem 0.5rem;
|
||||||
|
}
|
||||||
|
.navbar-brand{
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#liste-deroulante ul{
|
#liste-deroulante ul{
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11860,11 +11860,28 @@ a, a:hover {
|
||||||
#menu-principal {
|
#menu-principal {
|
||||||
padding: 1rem 2rem;
|
padding: 1rem 2rem;
|
||||||
background-color: #3b3f8a;
|
background-color: #3b3f8a;
|
||||||
|
-webkit-transition: all 1s;
|
||||||
|
transition: all 1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu-principal a {
|
#menu-principal .nav-link {
|
||||||
color: #f8f9fa;
|
color: #f8f9fa;
|
||||||
font-weight: 600;
|
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 {
|
#menu-principal .active a {
|
||||||
|
@ -11880,6 +11897,18 @@ a, a:hover {
|
||||||
color: #f8f9fa;
|
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 {
|
#liste-deroulante ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,11 +47,11 @@ jQuery(function($) {
|
||||||
var barnavOffset = 0;
|
var barnavOffset = 0;
|
||||||
$(window).on('scroll', function () {
|
$(window).on('scroll', function () {
|
||||||
if ( $(window).scrollTop() > barnavOffset ) {
|
if ( $(window).scrollTop() > barnavOffset ) {
|
||||||
$('header').addClass('navbar-fixed-reduite');
|
$('#menu-principal').addClass('reduit');
|
||||||
//$('button.burgermenu, #barnav ul.js-sous-menu').addClass('fixed-top');
|
//$('button.burgermenu, #barnav ul.js-sous-menu').addClass('fixed-top');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('header').removeClass('navbar-fixed-reduite');
|
$('#menu-principal').removeClass('reduit');
|
||||||
//$('button.burgermenu, #barnav ul.js-sous-menu').removeClass('fixed-top');
|
//$('button.burgermenu, #barnav ul.js-sous-menu').removeClass('fixed-top');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
2
js/mon_site.min.js
vendored
2
js/mon_site.min.js
vendored
|
@ -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
|
//# sourceMappingURL=mon_site.min.js.map
|
||||||
|
|
Loading…
Add table
Reference in a new issue