I use the jQuery UI slider to allow the user to increase / decrease the selection range, I need to know (according to the original value of the slider) if the user wants to increase or decrease.
Here is my function, I'm not sure where to put the code to extract the original value before changing it. Can anyone help me with this?
Any help / suggestions are welcome!
function createRangeSliderOutOfIframe(kinorid) {
$("#slider-range" + kinorid).slider({
animate: true,
step: 1,
min: 1,
max: 6,
value: 1,
slide: function (event, ui) {
},
change: function (event, ui) {
if (ui.value >= 1) {
var add = '<span class="kSelectedA">Link</span>';
$("#myFrame").contents().find('*').each(function () {
if ($(this).attr('kinorid') == kinorid) {
if (count == 0) {
$(result).parent().before(add);
count += 1;
}
else if (count <= 6 && count != 0) {
result = $(this).parent();
for (i = 0; i < count; i++) {
result = $(result).parent();
}
$(result).parent().before(add);
count += 1;
$('#trackingInfo').append('<br/>The range of the selection Increased<br/>The new range is now a' + $(result).parent().get(0).nodeName + 'node');
}
}
});
}
}
});
var value = $("#slider-range" + kinorid).slider("option", "value");
alert(value);
}
thank
source
share