How to show the value of Range Slider on the thumb of the Slider?

前端 未结 5 1037
醉酒成梦
醉酒成梦 2021-01-06 04:36

This is an odd request; However, what would be the best method to display the value of an HTML5 range-slider on the thumb of the slider?! the thumb will be animated onLoad s

5条回答
  •  半阙折子戏
    2021-01-06 04:54

    This "workaround" has lots and lots of lipstick on it... but it is possible with a automated derivation of Sebastien C. answer http://codepen.io/anon/pen/xbQoLj

    $(document).ready(function() {
        var $daFoo = $('#foo');
    
        var rule = "");
    
      $daFoo.on('input', function() { $daFoo.attr('data-value', $daFoo.val()) });
    });
    

提交回复
热议问题