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

126
Visualizações
How to use Next.js Image with parallax.js?

My site load a big image slowly: https://tikex-dev.com

This is the image: /young-people-dancing-tango-studio.jpg

The challange is, that <img> is created by parallax.js on client side. url is passed as a custom html tag with data-image-src

<section
    className="section-image light ken-burn-center"
    data-parallax="scroll"
    data-image-src="/young-people-dancing-tango-studio.jpg"
    style={{ background: 'transparent' }}
>

then here the js creates the <img>:

(this.$slider = t('<img />').prependTo(this.$mirror))
            : ((this.$slider = a.prependTo(this.$mirror)), (n = !0)),
            this.$mirror
                .addClass('parallax-mirror')
                .css({
                    visibility: 'hidden',
                    zIndex: this.zIndex,
                    position: 'fixed',
                    top: 0,
                    left: 0,
                    overflow: 'hidden',
                })
                .attr('data-source-id', this.$element.attr('id'))

What if image is big? Shall I modify parallax.js, and create a <Image instead of an <img>? It would not do the server side rendering for different dimensions of the image, right?

What approch exist to speed up loading this big image and use it as a background image in a parallax effect?

Shall I convert manually a 'normal' size image, instead of the 15MB?

about 4 years ago · Juan Pablo Isaza
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