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

252
Vistas
Overlay images Carousel bootstrap

I developed a dynamic carousel. Within a form I show several records and the ID of these records is related to n number of images that I show in a carousel, making it have n number of the carousel with n number of images each.

The problem is in the visualization. When I start to play with the carousels several times, they start to show the superimposed images mixing both images, for example.

Overlay images

My question is, what should I "clean" when loading the images so that things like this don't happen?

I execute this function JavaScript, Ajax to arm the carousel:

    function GetEvidenceScrap(id)
{
    var idcompleto = id.id;
    var i = 0;
    var idbutton = idcompleto.substring(2, idcompleto.length);
        $.ajax({
            method: "GET",
            url: "Coordinador/GetEvidenceScrap",
            contentType: "aplication/json; Charset=utf-8",
            data: { 'idscrap': idbutton },
            async: true,
            success: function (result) {
                console.log("Longitud: " + result.length);
                while (i < result.length)
                {
                    var carousel = document.getElementById('CI_' + idbutton);
                    if (i == 0)
                    {
                        var div = document.createElement('div');
                        div.setAttribute('class','carousel-item active');
                        var img = document.createElement("img");
                        img.setAttribute('class', 'd-block w-100');
                        div.appendChild(img);
                        img.setAttribute('src', '/Evidence/' + result[i].rutevidencia);
                        carousel.appendChild(div);
                        i++;
                    }
                    else
                    {
                        var div = document.createElement('div');
                        div.setAttribute('class', 'carousel-item');
                        var img = document.createElement('img');
                        img.setAttribute('class', 'd-block w-100');
                        div.appendChild(img);
                        img.setAttribute('src', '/Evidence/' + result[i].rutevidencia);
                        carousel.appendChild(div);
                        i++;
                    }   
                }
                console.log(result);
            }
        });

Function in C#:

[HttpGet]
    public List<Evidencia> GetEvidenceScrap(int idscrap)
    {
        var idscrapparametro = new SqlParameter("@idscrap", idscrap);
        var listaevidencescrap = _context.Evidencias.FromSqlRaw($"SELECT IDRegistro, IDScrap, rutevidencia FROM dbo.F_GetEvidenceScrap(@idscrap)", idscrapparametro);
        return listaevidencescrap.ToList();
    }

Thank you

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