/* GET PROPERTIES */ var grooveStyle; var profileFemaleMaterial; function getPropertyMaterial(){ //Achtung bei Ringpaar nach Situation entscheiden welches Object anzusprechen if(setGender == 'pairring'){ GetActiveItem('femalering','profile',CheckActiveProfileMaterial); GetActiveItem('femalering','width',getMaxWidth); GetAvalibleItems('femalering', 'pseudo_getmaterials', test); GetAvalibleItems('femalering', 'divisions', ShowAvailableDivisions); GetActiveItem('femalering','divisions',ShowActiveDivision); GetActiveItem('femalering','groove_style',ShowActiveGrooveStyle); GetAvalibleItems('femalering','groove_avalible',ShowAvailableGrooves); GetActiveItem('femalering','grooves',ShowActiveGrooves); GetAvalibleItems('femalering','pseudo_getgrooves', GetGroovesArray); GetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); }else{ GetActiveItem(setGender,'profile',CheckActiveProfileMaterial); GetActiveItem(setGender,'width',getMaxWidth); GetAvalibleItems(setGender,'pseudo_getmaterials', test); GetAvalibleItems(setGender,'divisions', ShowAvailableDivisions); GetActiveItem(setGender,'divisions',ShowActiveDivision); GetActiveItem(setGender,'groove_style',ShowActiveGrooveStyle); GetAvalibleItems(setGender,'groove_avalible',ShowAvailableGrooves); GetActiveItem(setGender,'grooves',ShowActiveGrooves); GetAvalibleItems(setGender,'pseudo_getgrooves', GetGroovesArray); GetActiveItem('setGender','alloy_au',ShowActiveAlloyAu); } GetAvalibleItems('malering','materials',test); } function CheckActiveProfileMaterial(data){ profileFemaleMaterial = parseFloat(data.value); } function GetGroovesArray(data){ if(!(data.any)){ if(data.items != null){ grooveValues = data.items; }else{ grooveValues = 0; } } groovesSlider(grooveValues); } /* SHOW THE AVAILABLE DIVISIONS */ function ShowAvailableDivisions(data){ // DISABLE ALL DIVISIONS $('#divisionlayer .division_section li').addClass('disabled'); disable(); if(data != null){ // ENABLE THE DIVISIONS NAMED BY ITEMS $.each(data.items, function(i,item){ $('#divisionlayer .division_section li a#div_'+item).parent().removeAttr('style').removeClass('disabled').unbind('click'); }); } } /* DIVISIONS */ function ShowActiveDivision(data){ $('#selected_division').attr('src', 'includes/steps/images/material/division_'+data.value+'.jpg'); $('#box_colormaterial div, #divisionlayer li').removeClass('selected'); $('#divisionlayer #div_'+data.value).parent().addClass('selected'); if(data.value == 0 ){ //alert('divisionShow'); $('.box_cm1').addClass('selected'); //$('#groovecount, #grooveposbox').css('visibility','visible'); GetActiveItem('femalering','groove_style',ShowActiveGrooveStyle); }else if((data.value >= 1) && (data.value <= 3) || (data.value == 12)){ $('.box_cm2').addClass('selected'); //GetActiveItem('femalering','grooves',ReShowActiveGrooves); $('#groovecount, #grooveposbox').css('visibility','hidden'); if(data.value == 12){ $('#groovesbox fieldset fieldset:eq(0) .jqTransformRadioWrapper a').addClass('jqTransformChecked'); $('#groovesbox .jqTransformRadioWrapper input:eq(0)').attr('checked', 'checked'); $('#groovesbox fieldset fieldset:eq(1), #groovesbox fieldset fieldset:eq(2)').addClass('disabled'); } }else{ $('.box_cm3').addClass('selected'); //GetActiveItem('femalering','grooves',ReShowActiveGrooves); $('#groovecount, #grooveposbox').css('visibility','hidden'); } } /* GET WIDTH FOR GROOVES MAX X */ function getMaxWidth(data){ maxGrooveWidth = data.value; } function ShowActiveAlloyAu(data){ $('#alloybox a[rel="alloy_au"]:eq('+data.value+')').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_au"]:eq('+data.value+')').addClass('jqTransformChecked'); $('#alloybox input[name="alloy_au"]:eq('+data.value+')').attr('checked', 'checked'); /* NOT NEEDED ANYMORE SINCE ONLY 1 GOLD ALLOY IS LEFT $('#alloybox a[rel="alloy_au"]:eq(0)').addClass('jqTransformChecked'); $('#alloybox input[name="alloy_au"]:eq(0)').attr('checked', 'checked'); */ } // PROPERTIES FOR DIVISIONS function ShowAvailableAlloyAu(data){ if($('#selected_division').attr('src') != 'includes/steps/images/material/division_0.jpg'){ $('#colorlist li a#c6').addClass('disabled'); } else { $('#colorlist li a#c6').removeClass('disabled').removeAttr('style').unbind('click'); } $('#alloybox input[name="alloy_au"]').removeAttr('checked'); $('#alloybox a[rel="alloy_au"]').removeClass('jqTransformChecked'); //$('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); //disable(); if(!(data.any)){ $.each(data.items, function(i,item){ if($('#selected_division').attr('src') == 'includes/steps/images/material/division_12.jpg'){ var division = 'nogrooves'; }else{ var division = 'grooves'; } if($('#box_colormaterial div.selected').attr('class') == 'box_cm1 selected'){ var disc1 = $('#s2_disc1').attr('class'); disc1 = disc1.slice(9,11); if((disc1 == 'c3'|| disc1 == 'c4'|| disc1 == 'c5'|| disc1 == 'c6')){ $('#alloybox a[rel="alloy_au"]').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); if(division == 'grooves'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').removeClass('disabled').removeAttr('style').unbind('click'); $('#groovesbox .jqTrans fieldset:eq(1) .disableGrooveOptions, #groovesbox .jqTrans fieldset:eq(2) .disableGrooveOptions').remove(); } $('#diacomp_02, #diacomp_03, #diacomp_04').removeClass('disabled').removeAttr('style').unbind('click'); //xxxGetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); if(setGender == 'pairring'){ GetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); } else { GetActiveItem(setGender,'alloy_au',ShowActiveAlloyAu); } }else if(disc1 == 'c2'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').addClass('disabled').append('
 
'); $('#diacomp_02, #diacomp_03, #diacomp_04').addClass('disabled'); disable(); }else{ if(division == 'grooves'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').removeClass('disabled').removeAttr('style').unbind('click'); $('#groovesbox .jqTrans fieldset:eq(1) .disableGrooveOptions, #groovesbox .jqTrans fieldset:eq(2) .disableGrooveOptions').remove(); } $('#diacomp_02, #diacomp_03, #diacomp_04').removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); disable(); } }else if($('#box_colormaterial div.selected').attr('class') == 'box_cm2 selected'){ var disc1 = $('#s2_disc1').attr('class'); disc1 = disc1.slice(9,11); var disc2 = $('#s2_disc2').attr('class'); disc2 = disc2.slice(9,11); if((disc1 == 'c3'|| disc1 == 'c4'|| disc1 == 'c5'|| disc1 == 'c6') || (disc2 == 'c3'|| disc2 == 'c4'|| disc2 == 'c5'|| disc2 == 'c6')){ if(disc1 == 'c2' || disc2 == 'c2'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').addClass('disabled').append('
 
');; $('#diacomp_02, #diacomp_03, #diacomp_04').addClass('disabled'); disable(); }else{ if(division == 'grooves'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').removeClass('disabled').removeAttr('style').unbind('click'); $('#groovesbox .jqTrans fieldset:eq(1) .disableGrooveOptions, #groovesbox .jqTrans fieldset:eq(2) .disableGrooveOptions').remove(); } $('#diacomp_02, #diacomp_03, #diacomp_04').removeClass('disabled').removeAttr('style').unbind('click'); } $('#alloybox a[rel="alloy_au"]').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); //xxxGetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); if(setGender == 'pairring'){ GetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); } else { GetActiveItem(setGender,'alloy_au',ShowActiveAlloyAu); } }else{ if(division == 'grooves'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').removeClass('disabled').removeAttr('style').unbind('click'); $('#groovesbox .jqTrans fieldset:eq(1) .disableGrooveOptions, #groovesbox .jqTrans fieldset:eq(2) .disableGrooveOptions').remove(); } $('#diacomp_02, #diacomp_03, #diacomp_04').removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); disable(); } }else if($('#box_colormaterial div.selected').attr('class') == 'box_cm3 selected'){ var disc1 = $('#s3_disc1').attr('class'); disc1 = disc1.slice(9,11); var disc2 = $('#s3_disc2').attr('class'); disc2 = disc2.slice(9,11); var disc3 = $('#s3_disc3').attr('class'); disc3 = disc3.slice(9,11); if((disc1 == 'c3'|| disc1 == 'c4'|| disc1 == 'c5'|| disc1 == 'c6') || (disc2 == 'c3'|| disc2 == 'c4'|| disc2 == 'c5'|| disc2 == 'c6') || (disc3 == 'c3'|| disc3 == 'c4'|| disc3 == 'c5'|| disc3 == 'c6')){ if(disc1 == 'c2' || disc2 == 'c2' || disc3 == 'c2'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').addClass('disabled').append('
 
');; $('#diacomp_02, #diacomp_03, #diacomp_04').addClass('disabled'); disable(); }else{ if(division == 'grooves'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').removeClass('disabled').removeAttr('style').unbind('click'); $('#groovesbox .jqTrans fieldset:eq(1) .disableGrooveOptions, #groovesbox .jqTrans fieldset:eq(2) .disableGrooveOptions').remove(); } $('#diacomp_02, #diacomp_03, #diacomp_04').removeClass('disabled').removeAttr('style').unbind('click'); } $('#alloybox a[rel="alloy_au"]').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); //xxxGetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); if(setGender == 'pairring'){ GetActiveItem('femalering','alloy_au',ShowActiveAlloyAu); } else { GetActiveItem(setGender,'alloy_au',ShowActiveAlloyAu); } }else{ if(division == 'grooves'){ $('#groovesbox .jqTrans fieldset:eq(1), #groovesbox .jqTrans fieldset:eq(2)').removeClass('disabled').removeAttr('style').unbind('click'); $('#groovesbox .jqTrans fieldset:eq(1) .disableGrooveOptions, #groovesbox .jqTrans fieldset:eq(2) .disableGrooveOptions').remove(); } $('#diacomp_02, #diacomp_03, #diacomp_04').removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); disable(); } } }); } //AnalyzeSetData(data); //Bild laden + Price Update } function ShowAvailableAlloyAu2(data){ $('#alloybox input[name="alloy_au2"]').removeAttr('checked'); $('#alloybox a[rel="alloy_au2"]').removeClass('jqTransformChecked'); $('#alloybox a[rel="alloy_au2"]').parent().parent().addClass('disabled'); disable(); if(!(data.any)){ $.each(data.items, function(i,item){ if(item==1){ if($('#box_colormaterial div.selected').attr('class') == 'box_cm1 selected'){ //alert('t1'); $('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); disable(); }else{ //alert('t2'); } $('#alloybox a[rel="alloy_au2"]').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_au2"]').addClass('jqTransformChecked'); $('#alloybox input[name="alloy_au2"]').attr('checked', 'checked'); } }); } //AnalyzeSetData(data); //Bild laden + Price Update } function ShowAvailableAlloyPt(data){ $('#alloybox input[name="alloy_pt"]').removeAttr('checked'); $('#alloybox a[rel="alloy_pt"]').removeClass('jqTransformChecked'); $('#alloybox a[rel="alloy_pt"]').parent().parent().addClass('disabled'); disable(); if(!(data.any)){ $.each(data.items, function(i,item){ if(item==1){ if($('#box_colormaterial div.selected').attr('class') == 'box_cm1 selected'){ $('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); disable(); } $('#alloybox a[rel="alloy_pt"]').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_pt"]').addClass('jqTransformChecked'); $('#alloybox input[name="alloy_pt"]').attr('checked', 'checked'); } }); } //AnalyzeSetData(data); //Bild laden + Price Update } function ShowAvailableAlloyPd(data){ $('#alloybox input[name="alloy_pd"]').removeAttr('checked'); $('#alloybox a[rel="alloy_pd"]').removeClass('jqTransformChecked'); $('#alloybox a[rel="alloy_pd"]').parent().parent().addClass('disabled'); disable(); if(!(data.any)){ $.each(data.items, function(i,item){ if(item==1){ if($('#box_colormaterial div.selected').attr('class') == 'box_cm1 selected'){ $('#alloybox a[rel="alloy_au"]').parent().parent().addClass('disabled'); disable(); } $('#alloybox a[rel="alloy_pd"]').parent().parent().removeClass('disabled').removeAttr('style').unbind('click'); $('#alloybox a[rel="alloy_pd"]').addClass('jqTransformChecked'); $('#alloybox input[name="alloy_pd"]').attr('checked', 'checked'); } }); } //AnalyzeSetData(data); //Bild laden + Price Update } /* POSSIBLE GROOVE COUNT */ function ShowAvailableGrooves(data){ $('#groovecount ul li').remove(); $('#groovecount select option').remove(); if(!(data.any)){ $.each(data.items, function(i,item){ for(g = 0; g < item; g++){ $('#groovecount ul').append('
  • '+(g+1)+'
  • '); $('#groovecount select').append(''); } }); } } /* GROOVE STYLE */ function ShowActiveGrooveStyle(data){ //alert('grooveStyle: '+data.value); $('#groovesbox input[name="fuge"]').removeAttr('checked'); $('#groovesbox a[rel="fuge"]').removeClass('jqTransformChecked'); $('#groovesbox .jqTransformRadioWrapper:eq('+data.value+') a').addClass('jqTransformChecked'); $('#alloybox input[name="fuge"]:eq('+data.value+')').attr('checked', 'checked'); if($('#selected_division').attr('src') != 'includes/steps/images/material/division_0.jpg'){ $('#groovecount, #grooveposbox').css('visibility', 'hidden'); }else if(data.value == 0){ $('#groovecount, #grooveposbox').css('visibility', 'hidden'); }else{ $('#groovecount, #grooveposbox').css('visibility', 'visible'); //groovesSlider(1); } } /* GROOVE ARRAY */ function ShowActiveGrooves(data){ $('#groovecount ul li a').removeClass('selected'); var grooves = data.value+''; grooves = grooves.split(','); grooves = grooves.length; groovesSet = grooves; $('#groovecount .jqTransformSelectWrapper span').html(grooves); $('#groovecount ul li:eq('+(grooves-1)+') a').addClass('selected'); } /* function ReShowActiveGrooves(data){ alert('reshow:'+ data.value); if(data.value != 0){ $('#groovecount, #grooveposbox').css('visibility', 'visible'); var grooves = parseFloat($('#groovecount .jqTransformSelectWrapper span').html()-1); $('#groovecount li:eq('+(grooves)+') a').addClass('selected'); if(setGender == 'pairring'){ GetActiveItem('femalering','groove_style',ShowActiveGrooveStyle); }else{ GetActiveItem(setGender,'groove_style',ShowActiveGrooveStyle); } }else{ if(setGender == 'pairring'){ SetItemValue('femalering','groove_style',0); }else{ SetItemValue(setGender,'groove_style',0); } } } */ // PROPERTIES FOR MATERIAL function ShowAvalibleMaterials(data){ if(!(data.any)){ $.each(data.items, function(i,item){ }); } } function test(data){ if(!(data.any)){ $.each(data.items, function(i,item){ for(d = 0; d < item.length; d++){ var c1 = parseFloat(item[0]['color'])-1; var s1 = parseFloat(item[0]['surface'])-1; var colorname1 = $('#colorlist li:eq('+c1+') a').text(); var surfacename1 = $('#surfacelist li:eq('+s1+') a').text(); var c2 = parseFloat(item[1]['color'])-1; var s2 = parseFloat(item[1]['surface'])-1; var colorname2 = $('#colorlist li:eq('+c2+') a').text(); var surfacename2 = $('#surfacelist li:eq('+s2+') a').text(); var c3 = parseFloat(item[2]['color'])-1; var s3 = parseFloat(item[2]['surface'])-1; var colorname3 = $('#colorlist li:eq('+c3+') a').text(); var surfacename3 = $('#surfacelist li:eq('+s3+') a').text(); $('#s1_disc1, #s2_disc1, #s3_disc1').attr('class', 'division c'+item[0]['color']+'m'+item[0]['surface']).html(colorname1+' / '+surfacename1); $('#s2_disc2, #s3_disc2').attr('class', 'division c'+item[1]['color']+'m'+item[1]['surface']).html(colorname2+' / '+surfacename2); $('#s3_disc3').attr('class', 'division c'+item[2]['color']+'m'+item[2]['surface']).html(colorname3+' / '+surfacename3); } }); if(setGender == 'pairring'){ GetAvalibleItems('femalering','alloy_au',ShowAvailableAlloyAu); GetAvalibleItems('femalering','alloy_au2',ShowAvailableAlloyAu2); GetAvalibleItems('femalering','alloy_pt',ShowAvailableAlloyPt); GetAvalibleItems('femalering','alloy_pd',ShowAvailableAlloyPd); }else{ GetAvalibleItems(setGender,'alloy_au',ShowAvailableAlloyAu); GetAvalibleItems(setGender,'alloy_au2',ShowAvailableAlloyAu2); GetAvalibleItems(setGender,'alloy_pt',ShowAvailableAlloyPt); GetAvalibleItems(setGender,'alloy_pd',ShowAvailableAlloyPd); } } } /* function getSelectedSettings(c){ //alert('c:'+c); } */ /* FUNCTIONS CALLED FROM CONF.JS */ /* SET DIVISION */ function setDivision(e){ // CHECK IF THERE ARE ONE/TWO/THREE DISCS var list = $(e).parent().parent().attr('id'); // SET ACTIVE CLASS TO THE SELECTED DIVISION $('#divisionlayer li').removeClass('selected'); $(e).parent().addClass('selected'); // GET SELECTED DIVISION AND CHANGE BIG DIVISION IMAGE var seldiv = $(e).attr('id'); seldiv = seldiv.substr('4'); $('#selected_division').attr('src', 'includes/steps/images/material/division_'+seldiv+'.jpg'); // SEND THE SELECTED DIVISION TO THE ARRAY SetItemValue(setGender,'divisions',seldiv); //setze(setGender,'divisions',seldiv); ReloadCollageImage(); // REMOVE SELECTED CLASS FROM THE COLOR/MATERIAL BOX $('#box_colormaterial div').removeClass('selected'); var support = new MaterialSupport(); // IF SINGLE COLOR if(seldiv == 0){ // SET BOX1 SELECTED $('.box_cm1').addClass('selected'); // SET GROOVES TO NONE $('#groovesbox fieldset fieldset:eq(1), #groovesbox fieldset fieldset:eq(2)').removeAttr('style').removeClass('disabled').unbind('click'); $('#groovesbox .jqTransformRadio').removeClass('jqTransformChecked'); $('#groovesbox .jqTransformRadio:eq(0)').addClass('jqTransformChecked'); $('#groovesbox .jqTransformRadioWrapper input').removeAttr('checked'); $('#groovesbox .jqTransformRadioWrapper input:eq(0)').attr('checked', 'checked'); //$('#groovecount, #grooveposbox').css('visibility','visible'); if(setGender == 'pairring'){ GetActiveItem('femalering','groove_style',ShowActiveGrooveStyle); GetAvalibleItems('femalering','groove_avalible',ShowAvailableGrooves); GetActiveItem('femalering','grooves',ShowActiveGrooves); GetAvalibleItems('femalering','pseudo_getgrooves', GetGroovesArray); }else{ GetActiveItem(setGender,'groove_style',ShowActiveGrooveStyle); GetAvalibleItems(setGender,'groove_avalible',ShowAvailableGrooves); GetActiveItem(setGender,'grooves',ShowActiveGrooves); GetAvalibleItems(setGender,'pseudo_getgrooves', GetGroovesArray); } }else if((seldiv >= 1) && (seldiv <= 3) || (seldiv == 12)){ if(seldiv == 12){ //alert('keine Fugen und Scheibe2 nur poliert'); SetItemValue(setGender,'groove_style',0); $('#groovesbox fieldset .jqTransformRadioWrapper a').removeClass('jqTransformChecked'); $('#groovesbox .jqTransformRadioWrapper input').removeAttr('checked'); $('#groovesbox fieldset fieldset:eq(0) .jqTransformRadioWrapper a').addClass('jqTransformChecked'); $('#groovesbox .jqTransformRadioWrapper input:eq(0)').attr('checked', 'checked'); $('#groovesbox fieldset fieldset:eq(1), #groovesbox fieldset fieldset:eq(2)').addClass('disabled'); disable(); }else{ //alert('remove disable'); $('#groovesbox fieldset fieldset:eq(1), #groovesbox fieldset fieldset:eq(2)').removeAttr('style').removeClass('disabled').unbind('click'); } $('#groovecount, #grooveposbox').css('visibility','hidden'); $('.box_cm2').addClass('selected'); //getSelectedSettings(1); }else{ $('#groovesbox fieldset fieldset:eq(1), #groovesbox fieldset fieldset:eq(2)').removeAttr('style').removeClass('disabled').unbind('click'); $('#groovecount, #grooveposbox').css('visibility','hidden'); $('.box_cm3').addClass('selected'); //getSelectedSettings(2); } $('#divselection_open').attr('id', 'divselection'); $('#divselection .divselection_close').attr('class','divselection_close'); support.handleColor(support.getFirstColor(), seldiv, function() { //alert('setDivision'); if(setGender == 'pairring'){ GetAvalibleItems('femalering','groove_avalible',ShowAvailableGrooves); GetAvalibleItems('femalering','pseudo_getgrooves', GetGroovesArray); GetAvalibleItems('femalering', 'pseudo_getmaterials', test); }else{ GetAvalibleItems(setGender,'groove_avalible',ShowAvailableGrooves); GetAvalibleItems(setGender,'pseudo_getgrooves', GetGroovesArray); GetAvalibleItems(setGender, 'pseudo_getmaterials', test); } $('#divisionlayer').hide(); }); } /* GROOVE POSITION SLIDER */ function groovesSlider(i) { var grooveValues = i; $('#groovesslider').unbind().slider( 'destroy' ); $('#groovesslider div').unbind().remove(); if($('#groovesslider').length != 0){ // CHECK IF SLIDER IS FOUND //alert('maxGrooveWidth:'+maxGrooveWidth); //alert('grooves: '+grooveValues); $( '#groovesslider' ).slider({ min: 0, max: maxGrooveWidth, values: grooveValues, step: 0.1, create: function( event, ui ){ $('#groovesslider > a').each(function (e) { $(this).attr('id', e); var pos = $(this).attr('id'); var label = Math.round(grooveValues[pos]/0.10)*0.10; label = label+''; label = label.substr(0,3); $('
    ').html(''+ label + '').appendTo($(this)); $('
    ').html('0 mm').appendTo($('#groovesslider')); $('
    ').html(maxGrooveWidth+'mm').appendTo($('#groovesslider')); }); }, start: function( event, ui ) { //alert(ui.values); }, slide: function( event, ui ) { //alert('min:'+$('#groovesslider').slider('min')); var spacing = 0.5; var pos = $('a.ui-state-active', this).attr('id'); pos = parseFloat(pos); if(ui.value > (ui.values[(pos+1)])-spacing){ return false; }else if(ui.value < (ui.values[(pos-1)])+spacing){ return false; }else if(ui.value < 0.5){ return false; }else if(ui.value > maxGrooveWidth-0.5){ return false; } $('#'+pos+' .groovePos .label span').html(ui.values[pos]); }, change: function( event, ui) { SetItemValue(setGender,'grooves',ui.values); } }); $('').appendTo('.ui-slider-handle'); //APPEND GROOVE IMAGE }; };