Widget:CJP4: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
$('#query-container').mouseover(updateDisplay); | $('#query-container').mouseover(updateDisplay); | ||
$('#update').click(updateDisplay); | $('#update').click(updateDisplay); | ||
$("#slider").slider({ | |||
min: 0, | |||
max: 25, | |||
step: 1, | |||
values: [1,25], | |||
slide: function(event, ui) { | |||
if (ui.values[0] < ui.values[1]) | |||
{ | |||
$("input.pillSizeSlider[data-index=0]").val(ui.values[0]); | |||
$("input.pillSizeSlider[data-index=1]").val(ui.values[1]); | |||
} | |||
else if (ui.values[0] > ui.values[1]) | |||
{ | |||
$("input.pillSizeSlider[data-index=1]").val(ui.values[0]); | |||
$("input.pillSizeSlider[data-index=0]").val(ui.values[1]); | |||
} | |||
else | |||
{ | |||
$("input.pillSizeSlider[data-index=0]").val(ui.values[0]); | |||
$("input.pillSizeSlider[data-index=1]").val(ui.values[1]); | |||
} | |||
} | |||
}); | |||
$("input.pillSizeSlider").change(function() { | |||
var $this = $(this); | |||
$("#slider").slider("values", $this.data("index"), $this.val()); | |||
}); | |||
}; | }; | ||
Line 66: | Line 95: | ||
function updateDisplay() { | function updateDisplay() { | ||