Input Range Slider functions

It is possible with an input range slider to call functions?

Example: A range slider with 4 value ( 0 - max 4). If the slider is on value 2 call a jQuery script.

Possible?

Answers


yes it is possible call function if your are using jquery range slider when you stop sliding there

Code examples:
Initialize the slider with the stop callback specified:

$( ".selector" ).slider({
  stop: function( event, ui ) {}
});

//Bind an event listener to the slidestop event:


$( ".selector" ).on( "slidestop", function( event, ui ) {} );

//event in stop event in jquery.

here is your code you can use this.

  $("#div-slider").change(function(event, ui) {
        // set the current value to whatever is selected.
             current = ui.value;
             if(current == 2){
                 $('#logo').hide("fast"); 
               }else{
                    $('#logo').show("fast");
                 }
  });

OK. It works. Here is the code:

 $("#div-slider").change(function(event, ui) {
    // set the current value to whatever is selected.
         current =   document.getElementById("slider-1").value; 
         if(current == 2){
             $('#logo').hide("fast"); 
           }else{
                $('#logo').show("fast");
             }

});

@Gaurav: A tip for your work.


Need Your Help

require a java inheritance design tip

java inheritance

I have an abstract super class and a few derived class.

PATCH https request from Parse

javascript node.js https parse-platform

I'm trying to make an https PATCH request from Parse Cloud code (to update part of an object in a Firebase application), and I'm running into the following issues: