• Resolved mircearenea

    (@mircearenea)


    I’m in a learning process. Please help me with following code:
    <script>
    jQuery(document).on(‘change’, ‘.slider1’, function(){
    var val = jQuery(“.slider1”).slider(“value”);
    if(val==2)
    jQuery(‘.test’).hide();
    });
    </script>
    //slider1 -class for a slider
    //test- class for a text area
    Thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mircearenea,

    The issue is simple, when you assign a class name to a field, it is applied to the totally of the field, to the tag that contains the label, the input tag, etc., but the events are triggered by the input tag, so, the corresponding code would be:

    <script>
    jQuery(document).on('change', '.slider1 input', function(){
    var val = jQuery(this).val();
    if(val==2) jQuery('.test').hide();
    else jQuery('.test').show();
    });
    </script>

    Best regards.

    Thread Starter mircearenea

    (@mircearenea)

    Ohh..
    Works great !!
    You are the best!

    Many thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting slider value’ is closed to new replies.