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

124
Vistas
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 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