I'm using locomotive-scroll library for smooth scrolling on my project. The scroll-container is on an html main tag (header and footer are not included). Everything is working except a part of the page is not displaying at the end (approximately the footer). I was searching in the CSS but I didn't find anything. Thanks.
Here is my markup :
<body>
<header role="banner">
<nav class="header__menu link-effect" role="navigation" aria-label="header-menu">
<a class="header__menu-item b-container" href="#0">
<span class="menu-item b-menu">Menu</span>
</a>
<div class="header__menu-item">
<a class="header__menu-item-logo" href="#"><svg class="icon icon-logo"><use xlink:href="#icon-logo"></use></svg></a>
</div>
<a class="header__menu-item" href="/#contact">
<span class="header__menu-item">Contact</span>
</a>
</nav>
</header>
<div class="b-nav" role="navigation">
<nav class="b-nav-wrapper">
<div class="button">
<a class="button-link" href="#">Catalogue</a>
</div>
<div class="button">
<a class="button-link" href="#">En développement</a>
</div>
<div class="button">
<a class="button-link" href="#">Le WIPP</a>
</div>
<div class="button">
<a class="button-link" href="#">L'équipe</a>
</div>
<div class="button chateau">
<a class="button-link" href="#">Festival de cinéma de Saint-Paul-Trois-Châteaux</a>
</div>
</nav>
</div>
<main role="main" id="scroll_container">
<!--<nav class="full__menu" role="navigation" aria-label="menu-blocs">
<?php
wp_nav_menu( array(
'theme_location' => "main_menu"
) );
?>
</nav>-->
<?php
print_view();
?>
<!--<aside>
<?php get_sidebar(); ?>
</aside>-->
</main>
<footer role="contentinfo">
<div class="footer-wrapper">
<div class="footer__logo">logo-picto</div>
<div class="footer__copyright"><p>©2020-Bootstrap-Label - Tous droits réservés</p></div>
</div>
</footer>
<?php wp_footer(); ?>
</body>
Problem
This is the reason why you don't see HTML rendered as expected:
The following will not work:
Solution
The
data-scroll-container
needs to be on an element that wraps all three parts (i.e.,<header>
,<main>
,<footer>
).The following will work: