A
A
Artur2017-06-21 21:08:05
Python
Artur, 2017-06-21 21:08:05

Why doesn't opening/hiding the JavaScript mobile menu work?

window.onload = function toggleMobileMenu() {
  var el = document.getElementById('tuch-menu');
  el.onclick = function() {
    var elem = document.getElementById('mobile-nav')
    elem.classList.toggle('hiddenMenu');
  }
}

<div class="mobile-header">
  <a href="index.html" id="mobile-logo"><span>Джек Лондон</span></a>
  <img src="www/img/mobile-menu-icon.png" alt="Мобильное меню для сайта, посвященного Джеку Лондону" id="tuch-menu">
  <div id="mobile-nav">
    <nav>
      <ul>
        <li><a href="index.html">Главная</a></li>
        <li><a href="biografy.html">Биография</a></li>
        <li><a href="spisok.html">Произведения</a></li>
        <li><a href="audio.html">Аудиокниги</a></li>
        <li><a href="gallery.html">Галерея</a></li>
        <li><a href="video.html">Видео</a></li>
        <li><a href="aforizmy.html">Афоризмы</a></li>
        <li><a href="raznoe.html">Разное</a></li>
        <li><a href="forum.html">Форум</a></li>
      </ul> 
    </nav>
  </div>
</div>

Why doesn't the code work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
differentiator, 2018-11-19
@differentiator

for _ in range(N_GENERATIONS):
    DNA_prod, pred = ga.evolve(5)          # natural selection, crossover and mutation, DNA_prod -ось x, pred-ось y
    print(pred)

This code just does N_GENERATIONS iterations, '_' is the name of the loop counter variable (this is chosen because the value is not used anywhere)

M
Maxim, 2017-06-21
@m_pchelnikov

Checked it works. codepen
Styles working? Is the image area clickable?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question