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

182
Views
Basic configurator? Replacing the pictures

I'm struggling with a problem. So I have fetched all the pictures from a json file. It loads and works great. The only problem is that when I click on the HTML element, that supposed to load the new div element with the new pictures, it is always visible when the pictures are removed and reloaded with the new ones. I mean it jumps up and down for a millisecond, till the new elements are loaded. I try to make similar like this here 360 Ansicht, but much simple, if you scroll down you will see the "360 Ansicht".

let loadPictures = async function ( objectIndex, carColorIndex, carIndex, indexOfActiveCarPicture = 0 ) {
    const carsThreeSixty = await fetch( '/360view.json' );
    const carsThreeSixtyRes = await carsThreeSixty.json();
    let pure = Object.entries( carsThreeSixtyRes );

    const html = document.createElement( 'div' );
    html.classList.add( 'rim-pictures' );
    html.classList.add( 'active' );

    for ( let j = 0; j < pure[objectIndex][1][carColorIndex].imagesForRotating[carIndex].length; j++ ) {
        let newImg = new Image();
        newImg.src = pure[objectIndex][1][carColorIndex].imagesForRotating[carIndex][j];

        html.appendChild( newImg );
    }
    document.querySelector( '.three-sixty-angle-container .color-pictures.active' ).innerHTML = '';
    document.querySelector( '.three-sixty-angle-container .color-pictures.active' ).appendChild( html );
    $( '.three-sixty-angle-container .rim-pictures.active img' ).eq( indexOfActiveCarPicture ).addClass( 'active' );
};
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!