Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page https://status.framasoft.org/incident/626.

Commit f07931dd authored by robin banquo's avatar robin banquo

header semi fixed

parent 26f35976
<nav class="nav menu-background" id="mainNav" role="navigation" style="z-index: 999">
<nav class="nav menu-background fixed nav-down" id="mainNav" role="navigation" style="z-index: 999">
<div class=" nav-wrapper container parent-hover">
<a id="logo-container" href="#" class="brand-logo second-color title-font relative " >
<check if="{{ @siteOptions['params']['siteLogo'] }}">
......
......@@ -28,4 +28,43 @@ $(document).ready(function () {
$('.navItems').click(()=>{
$('.button-collapse').sideNav('hide');
})
// Hide Header on on scroll down
var didScroll;
var lastScrollTop = 0;
var delta = 5;
var navbarHeight = $('#mainNav').outerHeight();
$(window).scroll(function(event){
didScroll = true;
});
setInterval(function() {
if (didScroll) {
hasScrolled();
didScroll = false;
}
}, 250);
function hasScrolled() {
var st = $(this).scrollTop();
// Make sure they scroll more than delta
if(Math.abs(lastScrollTop - st) <= delta)
return;
// If they scrolled down and are past the navbar, add class .nav-up.
// This is necessary so you never see what is "behind" the navbar.
if (st > lastScrollTop && st > navbarHeight){
// Scroll Down
$('#mainNav').removeClass('nav-down').addClass('nav-up');
} else {
// Scroll Up
if(st + $(window).height() < $(document).height()) {
$('#mainNav').removeClass('nav-up').addClass('nav-down');
}
}
lastScrollTop = st;
}
})
\ No newline at end of file
......@@ -8,37 +8,39 @@
<include if="{{ @isAdmin }}" href="./base/helpBtn/helpBtn.htm"/>
<include href="./base/nav/nav.htm"/>
<repeat group="{{ @siteStructure }}" key="{{ @position }}" value="{{ @section}}">
<check if="{{ @section['id'] === 'footer' }}">
<true>
<div class="" style="margin-top: 64px">
<repeat group="{{ @siteStructure }}" key="{{ @position }}" value="{{ @section}}">
<check if="{{ @section['id'] === 'footer' }}">
<true>
<include href="./base/footer/footer.htm"/>
</true>
<false>
<section class="relative moduleSectionContainer" id="{{@section['id']}}">
<include if="{{ @isAdminPage }}" href="./base/editBtns/addSection.htm" with="reference={{@section['id']}},positionReference='before'"/>
</true>
<false>
<section class="relative moduleSectionContainer" id="{{@section['id']}}">
<include if="{{ @isAdminPage }}" href="./base/editBtns/addSection.htm" with="reference={{@section['id']}},positionReference='before'"/>
<include href="{{ './modules/' . @section['module'] . '/module.htm' }}" with="id={{@section['id']}},fields={{@section['fields']}}"/>
<check if="{{ @isAdminPage }}">
<include href="{{ './modules/' . @section['module'] . '/module.htm' }}" with="id={{@section['id']}},fields={{@section['fields']}}"/>
<check if="{{ @isAdminPage }}">
<include href="./base/generalModuleOptions/generalModuleOptions.htm" with="id={{@section['id']}}"/>
</check>
<include href="./base/generalModuleOptions/generalModuleOptions.htm" with="id={{@section['id']}}"/>
</check>
</section>
</false>
</section>
</false>
</check>
</repeat>
<a class="fixed btn-floating btn-large menu-background waves-effect waves-light tooltipped light-shadow" data-position="left"
data-delay="350" data-tooltip="retour haut de page" id="ScrollTopBtn" style="opacity : 0; z-index: 200 !important; bottom: 20px; right: 20px ">
<i class="material-icons second-color medium">arrow_upward</i>
</a>
</div>
</check>
</repeat>
<a class="fixed btn-floating btn-large menu-background waves-effect waves-light tooltipped light-shadow" data-position="left"
data-delay="350" data-tooltip="retour haut de page" id="ScrollTopBtn" style="opacity : 0; z-index: 200 !important; bottom: 20px; right: 20px ">
<i class="material-icons second-color medium">arrow_upward</i>
</a>
<check if="{{ @isAdminPage }}">
<include href="./base/editBtns/addSectionModal.htm"/>
<include href="./base/includes/saveBtn.htm"/>
......
......@@ -764,4 +764,17 @@ height: 110px;
left: 0;
width: 100%;
height: 100%;
}
#mainNav {
height: 64px;
position: fixed;
top: 0;
transition: top 0.2s ease-in-out;
width: 100%;
}
.nav-up {
top: -64px !important;
}
\ No newline at end of file
......@@ -55,7 +55,8 @@
"type": "text",
"value": "<h5>D'une simplicit\u00e9 d\u00e9coiffante<\/h5><p>Dans NoemieCMS, tout est pens\u00e9 pour \u00eatre le plus intuitif possible<\/p>"
}
}
},
"inMenuAs": "sefsefsefsefse"
},
{
"id": "5a9daf76dc692",
......@@ -131,7 +132,8 @@
"type": "text",
"value": "<p>Installez vos images ou gardez celles qui sont fournies ou faites un panach\u00e9. Galerie d\u2019images, carrousel, cartes anim\u00e9es, etc.<\/p>"
}
}
},
"inMenuAs": "sefefsefsef"
},
{
"id": "5a9daf76dc788",
......@@ -175,7 +177,8 @@
"type": "text",
"value": "https:\/\/framagit.org\/framasoft\/PrettyNoemieCMS"
}
}
},
"inMenuAs": "sefsefsefseffe"
},
{
"id": "footer",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment