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

253
Visualizações
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 à 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