Y
Y
yarcowen2017-10-22 14:16:48
css
yarcowen, 2017-10-22 14:16:48

Why doesn't bootstrap navbar work on mobile?

Hello! Not opening "sandwich" on non-PC screens in bootstrap navbar. Here is the code:

<nav class="navbar navbar-fixed-top navbar-custom navbar-transparent">
    <div class="container">		
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#custom-collapse">
          <span class="sr-only">Навигация</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
    
        <a class="navbar-brand" href="#">
          <img class="light-logo" src="assets/images/logo.png" width="185">
        </a>
      </div>

      <div class="collapse navbar-collapse" id="custom-collapse">		
        <ul class="nav navbar-nav navbar-right">
          <li><a class="white" href="#news">Новости</a></li>
          <li><a href="/event/">Мероприятия</a></li>
        </ul>				
      </div>		
    </div>
  </nav>

What is the reason?
bootstrap version: 3.3.6

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2017-10-22
@yarcowen

Works for me. But the "sandwich" icon itself is not displayed (due to the non-connected Glyphicons font). Have you included this font? The navbar uses an icon from this font for the button to open / close the menu on the mobile. devices. And did you include jQuery before Bootstrap?

S
Semyon Sorokin, 2017-10-22
@semsor

Jquery and scripts of the framework itself connected?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question