Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

325
Vistas
How to improve toggle menu with CSS and JavaScript?

I have implemented a functional menu of chapters(left) and Units(right) that works as i want and seen on the image i have attached. The problem is that it is slow, as i generate the CSS and JavaScript dynamically, so as to define the right ids for each element.

enter image description here

enter image description here

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should get your data from the Database all at once:

What about doing this:

SELECT menuChapters.id, menuUnits.id
FROM menuChapters INNER JOIN menuUnits
ON (menuChapters.id = menuUnits.chapter_id)
WHERE menuChapters.class=$get_class AND menuChapters.course=$get_course AND menuChapters.visibility=1
ORDER BY menuChapters.chapterOrder ASC, menuUnits.unitsOrder ASC

This should give you a list where you have the id of your chapter and the id of your unit for each row.

I didn't try the code, so it might have some issues.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda