html5 - Flipped Range/Slider input html -


does know how achieve this? eg. starts max low (left right):

---------------------||---------------------

100__________50__________20

check out jsfiddle link.

html part:

<input id="slider2" type="range" min="0" max="100" step="50" value="0" > <input id="rangevalue2" type="text" size="2"> 

javascript part:

var max_range = 100; var range_element = document.getelementbyid("rangevalue2"); var range_input_element = document.getelementbyid("slider2"); range_element.value = max_range - range_input_element.value; document.getelementbyid("slider2").onchange=function(){     range_element.value = max_range - range_input_element.value; }; 

note: max range should same in html , javascript. in html set max="100" , in javascript set var max_range = 100;


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

qt - How to embed QML toolbar and menubar into QMainWindow -