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

130
Visualizações
Reinitializing CSS-Element-Queries after an ajax call

I'm using css-element-queries (https://github.com/marcj/css-element-queries) to apply styles based on the element's size, but I'm also dynamically adding elements via an ajax call. Elements loaded via ajax are not being styled properly, presumably because they aren't present when the css-element-queries script is executed. css-element-queries runs automatically on window.load so I'm unclear on how to get it to run after the ajax call is successful. I'm using jquery, so jquery-specific responses are welcome.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

css-element-queries has a work around.

https://github.com/marcj/css-element-queries/issues/31

It is possible to force the window.load event,

dispatchEvent(new Event('load'));

but it is deprecated and could circle your Ajax into a loop, unless your ajax is not being done by the onload event. IE Old school netscape 2, document.write method.

document.write("<script src='ajax.js'><"+"/"+"script>");
about 4 years ago · Santiago Trujillo Relatório
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