Les résultats des élections en Castilla y León, rue par rue

Les résultats des élections en Castilla y León, rue par rue

`, div : « .a_t », onInsert : function() { const baseUrl= »https://ep00.epimg.net/infografias/2026/03/elecciones-cyl/gorrillo/ »; const images = ('pptrazo.png', 'psoetrazo.png', 'voxtrazo.png', 'upltrazo.png', 'xatrazo.png'); const boxes = ( (document.getElementById('locker-img1a'), document.getElementById('locker-img1b')), (document.getElementById('locker-img2a'), document.getElementById('locker-img2b')), (document.getElementById('locker-img3a'), document.getElementById('locker-img3b')) ); états const = (0, 0, 0); indices const = (0, 1, 2); laissez lastBox = -1; const cache = {}; images.forEach(function(name, i) { const img = new Image(); img.src = baseUrl + name; cache(i) = img; }); function changeOne() { const disponible = lastBox === -1 ? (0,1,2) : (0,1,2).filter(i => i !== lastBox); const boxIdx = disponible(Math.floor(Math.random() * available.length)); lastBox = boxIdx; laissez options = images.map((_, i) => i).filter(i => !indices.includes(i)); if (options.length === 0) { options = images.map((_, i) => i).filter(i => i !== indices(boxIdx)); } const newIdx = options(Math.floor(Math.random() * options.length)); indices(boxIdx) = newIdx; const box = boîtes (boxIdx); const currentState = states(boxIdx); const newimg = box(1 – état actuel); const currentimg = box (état actuel); const url = baseUrl + images (newIdx); newimg.src = url; function makeCrossfade() { imgNew.classList.add('active'); imgActual.classList.remove('active'); states(boxIdx) = 1 – état actuel ; } if (newimg.complete && newimg.naturalWidth > 0) { makeCrossfade(); } else { newimg.onload = makeCrossfade; newimg.onerror = makeCrossfade; } } soit chargé = 0; soit intervalle = nul ; function init() { const idx = (); const disponible = images.map((_, i) => i); pour (soit i = 0; i < 3; i++) { const r = Math.floor(Math.random() * available.length); idx.push(disponible(r)); disponible.splice(r, 1); } indices(0) = idx(0); indices(1) = idx(1); indices(2) = idx(2); boxes.forEach(function(box, i) { const img = box(0); const url = baseUrl + images(idx(i)); img.src = url; if (img.complete) { img.classList.add('active'); chargé++; if (loaded === 3 && !interval) interval = setInterval(changeOne, 1000); } else { img.onload = function() { this.classList.add('active'); } init();

A lire également