Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!