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

101
Vistas
How to apply a style with on the mobile menu?

On my Drupal 9 website, I activated the Olivero default theme. Here is a demonstration :

https://tugboat-aqrmztryfqsezpvnghut1cszck2wwasr.tugboatqa.com/

I added to my subtheme, the following code :

script.js :

(function ($, Drupal, window, document) {
  $(document).ready(function () {
 
    window.addEventListener("scroll", function() {
      if (document.body.scrollTop > 1 || document.documentElement.scrollTop > 1) {
        document.getElementById("site-header__inner").style.boxShadow = "-36px 1px 36px rgb(0 0 0 / 8%)";
      } else {
        document.getElementById("site-header__inner").style.boxShadow = "none";
      }
    });
      
  });
})(jQuery, Drupal, this, this.document);

The problem is that the style is applied to the mobile menu and the desktop menu. How does this code only apply to the mobile menu ?

When I inspect the page, I find this in css, but I don't know how to use it for the solution of my question :

@media (min-width: 75rem)
body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed.toolbar-tray-open .site-header__fixable.is-fixed {
    top: 0.4375rem;
}
about 4 years ago · Juan Pablo Isaza
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