I'd like to display sliders only when an input field is active on a form, and hide it otherwise. I'm able to display the slider on a mouseenter event. I'd like to hide it on a mouseleave event. I'm able to call functions on mouseenter and mouseleave:
<code>
$('#edit-v01price').mouseenter(v01price_input_enter); {
}
$('#edit-v01price').mouseleave(v01price_input_leave); {
}
</code>
Mouseenter will display the slider when the user is over the input field and I am able to display the alert message when the user leaves the input field using the following:
<code>
function v01price_input_enter() {
var field_value = $('#edit-v01price').val();
$( "#v01price-slide" ).slider({
range: "max",
min: 1,
max: 100000,
value: field_value,
slide: function( event, ui ) {
$( "#edit-v01price" ).val( ui.value );
v01_interact();
}
});
}
function v01price_input_leave () {
alert('leaving');
}
</code>
I'm not sure what to use to hide the slider on mouseleave by replacing the alert message with the appropriate code.
Thanks.