• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

584
Vistas
How to fit image to specific cropped area to only move with Cropper JS

I'm using cropper JS to resize images to a specific crop area. But when I upload a image that is lower than crop area, the image don't fit the area. I want to fit the image (height or widht) and only choose the crop area moving the image, like the facebook upload cover photo functionality.

Here is my actual code:

        const cropper = new Cropper(image, {
            viewMode: 0, 
            zoomable: false,
            movable: true,
            cropBoxResizable: false,
            cropBoxMovable: true,
            dragMode: 'move',
            data: {
                width: 1370,
                height: 385,
            },
        })

And I want this result like facebook

enter image description here

What I want to achieve is zoom the image till fill the cropped size

almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda