function getModellen(automerk) { jQuery.ajax({ url: "http://www.cavaro.be/scripts/getmodellenhome.php?lang=nl&automerk="+automerk, cache: false }) .done(function( html ) { jQuery( "#autotypes" ).html( html ); jQuery( "#velgen" ).html( "" ); }); } function getVelgen(autotype) { jQuery.ajax({ url: "http://www.cavaro.be/scripts/getvelgen.php?autotype="+autotype+"&navid=1&lang=nl", cache: false }) .done(function( html ) { jQuery( "#velgen" ).html( html ); var baseMargin = 20; jQuery('.referentieboxzoom').hover(function() { jQuery(this).stop().animate({opacity: 0.5}, 300); }, function() { jQuery(this).stop().animate({opacity: 0}, 600); }); snelheidsteller=0; jQuery('.referentieboxlijst').each( function(i){ var top_of_object = jQuery(this).position().top; var bottom_of_object = jQuery(this).position().top + jQuery(this).outerHeight(); var bottom_of_window = jQuery(window).scrollTop() + jQuery(window).height(); snelheidsteller+=75; /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > top_of_object ){ var number = 1 + Math.floor(Math.random() * 1500); jQuery(this).animate({'opacity':'1'},snelheidsteller); } }); }); } function getVelgenViaMerk(velgmerk) { jQuery.ajax({ url: "http://www.cavaro.be/scripts/getvelgenviamerk.php?velgmerk="+velgmerk+"&navid=1&lang=nl", cache: false }) .done(function( html ) { jQuery( "#velgen" ).html( html ); var baseMargin = 20; jQuery('.referentieboxzoom').hover(function() { jQuery(this).stop().animate({opacity: 0.5}, 300); }, function() { jQuery(this).stop().animate({opacity: 0}, 600); }); snelheidsteller=0; jQuery('.referentieboxlijst').each( function(i){ var top_of_object = jQuery(this).position().top; var bottom_of_object = jQuery(this).position().top + jQuery(this).outerHeight(); var bottom_of_window = jQuery(window).scrollTop() + jQuery(window).height(); snelheidsteller+=75; /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > top_of_object ){ var number = 1 + Math.floor(Math.random() * 1500); jQuery(this).animate({'opacity':'1'},snelheidsteller); } }); }); }