Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

107
Visualizações
How to integrate Materialize's modal in Navigation Bar?

I am currently working on a project using Materialize CSS where a popup login portal will appear overlaying the home screen after clicking the login button located in the navigation bar.

The issue is that the modal does not appear when I am trying to click the login button. Others suggest to include the JavaScript code for the Materialize modal which I did but it still does not work. I was hoping to ask if the issue lies with how the <div> tags is enclosed within the <ul> tags or I have overlooked something.

Below is the code I used and the design of the application:

nav.hbs

<nav>
    <div class="nav-wrapper">
        <a href="#" class="brand-logo">
            <img src="/imgs/logo-white.png" width="200px" height="50px">
        </a>
        <ul id="nav-mobile" class="right hide-on-med-and-down">
            <li>
                <a class="waves-effect waves-light btn modal-trigger" href="#modal1">Login</a>
            </li>
            <!-- Modal Structure -->
            <div id="modal1" class="modal">
                <div class="modal-content">
                    <h4>Modal Header</h4>
                    <p>A bunch of text</p>
                </div>
                <div class="modal-footer">
                    <a href="#!" class="modal-close waves-effect waves-green btn-flat">Agree</a>
                </div>
            </div>
        </ul>
    </div>
</nav>


<script type="text/javascript">
    $(document).ready(function () {
        $('#modal1').modal();
    });
</script>

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda