js header

This commit is contained in:
ouidade 2024-02-28 10:26:28 +01:00
parent 7c1efed323
commit 12903709d1
3 changed files with 37 additions and 13 deletions

View File

@ -152,6 +152,7 @@ header {
max-width: 100vw; max-width: 100vw;
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
position: relative;
top: 0; top: 0;
border-bottom: 1px solid #808080; } border-bottom: 1px solid #808080; }
@media (max-width: 800px) { @media (max-width: 800px) {
@ -177,12 +178,18 @@ header {
header .language-switcher-language-url ul li:nth-child(1)::after { header .language-switcher-language-url ul li:nth-child(1)::after {
content: "/"; } content: "/"; }
header .header_nav_container { header .header_nav_container {
display: grid; display: none;
grid-template-columns: repeat(12, 1fr); grid-template-columns: repeat(12, 1fr);
grid-gap: 10px; grid-gap: 10px;
grid-row: 3; grid-row: 3;
grid-column: 1 /span 12; grid-column: 1 /span 12;
background: #e8ebf4; } position: absolute;
top: 100%;
width: 100%;
background: #e8ebf4;
border-bottom: 1px solid #808080;
border-top: 1px solid #808080;
font-size: 1rem; }
header .header_nav_container #block-quartiers-de-demain-entete { header .header_nav_container #block-quartiers-de-demain-entete {
grid-column: 1 /span 11; grid-column: 1 /span 11;
order: 2; order: 2;
@ -204,7 +211,7 @@ header {
header .close-block { header .close-block {
order: 1; order: 1;
grid-column: 12; grid-column: 12;
display: grid; display: none;
margin: auto; } margin: auto; }
header .close-block span { header .close-block span {
transform-origin: center; } transform-origin: center; }

View File

@ -17,17 +17,18 @@
} (Drupal)); } (Drupal));
jQuery(document).ready(function($){ jQuery(document).ready(function($){
$('.close-block').click(function(){ // $('.close-block').click(function(){
$(this).parent().fadeOut(); // $(this).parent().fadeOut();
if(mobile == true){ // if(mobile == true){
$("body").css("overflow","auto"); // $("body").css("overflow","auto");
} // }
}); // });
$('.open-block').click(function(){ $('.open-block').click(function(){
$(this).prev().css("display","grid"); $(this).prev().css("display","grid");
if(mobile == true){ if(mobile == true){
@ -35,7 +36,10 @@
} }
}); });
// Hide the header_nav_container when a link inside it is clicked
$('.header_nav_container li').click(function() {
$('.header_nav_container').fadeOut();
}); });
});

View File

@ -10,6 +10,7 @@ header{
max-width: 100vw; max-width: 100vw;
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
position: relative;
top: 0; top: 0;
border-bottom: 1px solid #808080; border-bottom: 1px solid #808080;
@media (max-width:800px) { @media (max-width:800px) {
@ -21,6 +22,7 @@ header{
} }
.header_left_container{ .header_left_container{
grid-column: 1 /span 11; grid-column: 1 /span 11;
grid-row: 1 /span 3; grid-row: 1 /span 3;
@ -60,12 +62,23 @@ header{
} }
.header_nav_container{ .header_nav_container{
display: grid; display: none;
// display: grid;
grid-template-columns: repeat(12, 1fr); grid-template-columns: repeat(12, 1fr);
grid-gap: 10px; grid-gap: 10px;
grid-row: 3; grid-row: 3;
grid-column: 1 /span 12; grid-column: 1 /span 12;
position: absolute;
top: 100%;
width: 100%;
background: $bleu_fond_header; background: $bleu_fond_header;
border-bottom: 1px solid #808080;
border-top: 1px solid #808080;
font-size: $font-big;
#block-quartiers-de-demain-entete{ #block-quartiers-de-demain-entete{
grid-column: 1 /span 11; grid-column: 1 /span 11;
@ -96,7 +109,7 @@ header{
.close-block{ .close-block{
order: 1; order: 1;
grid-column: 12; grid-column: 12;
display: grid; display: none;
margin: auto; margin: auto;
span{ span{
transform-origin: center; transform-origin: center;