var timer_schalen; var bezig; var afb_teller; function init_afb(){ afb = new Array(); url_ar = new Array(); nieuw_venster_ar = new Array(); afb_teller = 1; bezig = false; aantal_afb = 3; afb[1] = "pics/banner/107/thumbs/950x334_Barbie Neeskensnl 950x334_Tekengebied 1.jpg"; url_ar[1]= "https://www.n-gear.eu/zoeken?actie=zoeken&favoriet_pagina=2&zoek_veld=159753"; nieuw_venster_ar[1]= "_self"; afb[2] = "pics/banner/109/thumbs/950x334_950x334_ngear_gold-01.jpg"; url_ar[2]= "https://www.flipsnack.com/neeskens/n-gear-flipsnack-2023/full-view.html"; nieuw_venster_ar[2]= "_blank"; afb[3] = "pics/banner/108/thumbs/950x334_Pianomat 950x334 v2_HighRes-01.jpg"; url_ar[3]= "https://www.n-gear.eu/floor-toy-xxl-piano-dance-mat"; nieuw_venster_ar[3]= "_self"; } function change(nr_afb){ console.log(nr_afb); if (bezig == false) { bezig = true; afb_teller = nr_afb; // pe.stop(); var bolletjes_html = ''; for (teller = 1;teller < (3 + 1);teller++) { if (nr_afb == teller) bolletjes_html = bolletjes_html + ''; else bolletjes_html = bolletjes_html + ''; } document.getElementById('slider_balletjes').innerHTML = bolletjes_html; var pijl_nr = nr_afb + 1; if (nr_afb == 3) { pijl_nr = 1; } var wissel = afb[nr_afb]; var url = url_ar[nr_afb]; var target = nieuw_venster_ar[nr_afb]; //alert(wissel); $foto = wissel; img = new Image(); img.onload = function(){ // image has been loaded $( "#flash_content1" ).fadeOut( "slow", function() { // Animation complete. $html_new = ""; $('#flash_content1').html($html_new); $('#flash_content1').fadeIn(); bezig = false; }); }; img.src = $foto; } afb_teller++; if(afb_teller > 3){ afb_teller = 1; } window.clearTimeout(timer_schalen); timer_schalen = window.setTimeout(function() { change(afb_teller);}, 12000); } $(document).ready(function() { init_afb(); afb_teller++; if(afb_teller > 3){ afb_teller = 1; } window.clearTimeout(timer_schalen); timer_schalen = window.setTimeout(function() { change(afb_teller);}, 12000); });