range-touch
Version:
range-touch is my answer to: http://stackoverflow.com/questions/5484540
41 lines (31 loc) • 1.66 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title><input type="range"></title>
<!-- CSS Styles are 100% Optional! -->
<link rel="stylesheet" href="https://cdn.rawgit.com/dwyl/range-touch/master/demo/style.css">
</head>
<body>
<!-- no styles just browser default -->
<h2> <input type="range"> (browser default)</h2>
<input type="range">
<!-- a bit more style -->
<h2> <input type="range" class="custom"> (a bit of style)</h2>
<input type="range" class="custom" value ="0">
<!-- a bit more style -->
<h2> <input type="range" class="custom"> (customize everything)</h2>
<input type="range" class="custom" min="0" max="100" value ="0">
<h2> <input type="range" class="display-value"> (display value while sliding)</h2>
<input type="range" class="custom display-value" min="0" max="100" value ="0">
<output>0</output>%
<!-- Pick a JavaScript (DOM) Libarary -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.2.min.js"></script> <!-- 26kb -->
<!-- OR -->
<!-- <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> 93kb!! -->
<!-- load the range-touch.js file to enable slider on touch devices -->
<script type="text/javascript" src="https://cdn.rawgit.com/dwyl/range-touch/master/range-touch.min.js"></script>
<!-- OPTIONAL: display the value as the slider is changing -->
<script type="text/javascript" src="https://cdn.rawgit.com/dwyl/range-touch/master/demo/display-range-value.js"></script>
</body>
</html>