essai

require(['jquery', 'jquery/ui'], function($){ $(document).ready(function(){ $("#inch-slider").hide(); $("input[name$='unit']").click(function() { var test = jQuery(this).val(); $("#inch-slider , #cm-slider").hide(); $("#"+test).show(); }); // Vélos classiques *0,67 $("#calc-cm").click(function() { var inscm = ($("#inseam-cm").val()*0.665); var result = inscm.toPrecision(2) var sizes={47:'47-47.5-48',48:'47-47.5-48-48.5-49',49:'48-48.5-49-49.5-50-50.5',50:'49-49.5-50-50.5-51-51.5',51:'50-50.5-51-51.5-52-52.5',52:'51-51.5-52-52.5-53-53.5',53:'52-52.5-53-53.5-54-54.5',54:'53-53.5-54-54.5-55-55.5',55:'54-54.5-55-55.5-56-56.5',56:'55-55.5-56-56.5-57-57.5',57:'56-56.5-57-57.5-58-58.5',58:'57-57.5-58-58.5-59-59.5',59:'58-58.5-59-59.5-60-60.5',60:'59-59.5-60-60.5-61-61.5',61:'60-60.5-61-61.5-62-62.5',62:'61-61.5-62-62.5-63-63.5',63:'62-62.5-63-63.5-64-64.5',64:'63-63.5-64',65:'64-65',66:'65-66-67',67:'66-67'}; var size=sizes[+result]; $("#bikecalc-result-cm").html('Votre taille est '+ résultat +' +/- 1,5 cm. Voir les vélos → '); }); // Pouces $("#calc-inch").click(function(){ var insinch = (($("#inseam-inch").val()*2.54)*0.665); var resulti = insinch.toPrecision(2) var sizes={47:'47-47.5-48',48:'47-47.5-48-48.5-49',49:'48-48.5-49-49.5-50-50.5',50:'49-49.5-50-50.5-51-51.5',51:'50-50.5-51-51.5-52-52.5',52:'51-51.5-52-52.5-53-53.5',53:'52-52.5-53-53.5-54-54.5',54:'53-53.5-54-54.5-55-55.5',55:'54-54.5-55-55.5-56-56.5',56:'55-55.5-56-56.5-57-57.5',57:'56-56.5-57-57.5-58-58.5',58:'57-57.5-58-58.5-59-59.5',59:'58-58.5-59-59.5-60-60.5',60:'59-59.5-60-60.5-61-61.5',61:'60-60.5-61-61.5-62-62.5',62:'61-61.5-62-62.5-63-63.5',63:'62-62.5-63-63.5-64-64.5',64:'63-63.5-64',65:'64-65',66:'65-66-67',67:'66-67'}; var size=sizes[+resulti]; $("#bikecalc-result-inch").html('Votre taille est '+ resulti +' +/- 1,5 cm. Voir les vélos → '); }); }); })