---
{
	"title": "Input type=\"range\" polyfill (slider control)",
	"language": "en",
	"category": "Polyfills",
	"categoryfile": "polyfills",
	"description": "Emulates <input type=\"range\"> support for browsers that do not have support. The <input type=\"range\"> element displays a slider control bar.",
	"altLangPrefix": "slider",
	"dateModified": "2014-08-04"
}
---
<span class="wb-prettify all-pre hide"></span>

<section>
	<h2>Purpose</h2>
	<p>The <code>&lt;input type="range" /&gt;</code> element enables the display of a slider control bar. Because some browsers do not support this functionality natively, this polyfill emulates the same functionality using generic HTML and WAI-ARIA.</p>
</section>

<section>
	<h2>Working example</h2>
	<ul>
		<li><a href="../../../demos/slider/slider-en.html">English examples</a></li>
		<li><a href="../../../demos/slider/slider-fr.html">French examples</a></li>
	</ul>
</section>

<section>
	<h2>How to implement</h2>
	<p>To use the polyfill, a standard <code>input type="range"</code> element must be used. In cases where a browser doesn't support the <code>input type="range"</code> element, the polyfill is automatically loaded.</p>
</section>

<section>
	<h2>Configuration options</h2>
	<p><a href="https://www.w3.org/TR/html5/forms.html#range-state-%28type=range%29">Configuration options available for the <code>input type="range"</code> element (HTML5 specification)</a></p>
</section>

<section>
	<h2>Events</h2>
	<table class="table">
		<thead>
			<tr>
				<th>Event</th>
				<th>Trigger</th>
				<th>What it does</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><code>wb-init.wb-slider</code></td>
				<td>Triggered manually (e.g., <code>$( "input[type='range']" ).trigger( "wb-init.wb-slider" );</code>).</td>
				<td>Used to manually initialize the <code>input type="range"</code> polyfill. <strong>Note:</strong> The <code>progress</code> polyfill will be initialized automatically unless the <code>input type="range"</code> element is added after the page has already loaded.</td>
			</tr>
			<tr>
				<td><code>wb-update.wb-slider</code></td>
				<td>Triggered manually (e.g., <code>$( "input[type='range']" ).trigger( "wb-update.wb-slider" );</code>).</td>
				<td>Used to manually update the <code>input type="range"</code> polyfill.</td>
			</tr>
			<tr>
				<td><code>wb-ready.wb-slider</code> (v4.0.5+)</td>
				<td>Triggered automatically after the <code>progress</code> polyfill initializes. <strong>Note:</strong> This event will only be triggered if the polyfill is loaded. The polyfill will not load for browsers with native <code>input type="range"</code> support.</td>
				<td>Used to identify where the <code>input type="range"</code> polyfill initialized (target of the event)
					<pre><code>$( document ).on( "wb-ready.wb-slider", "input[type='range']", function( event ) {
});</code></pre>
					<pre><code>$( "input[type='range']" ).on( "wb-ready.wb-slider", function( event ) {
});</code></pre>
				</td>
			</tr>
			<tr>
				<td><code>wb-updated.wb-slider</code> (v4.0.5+)</td>
				<td>Triggered automatically after the <code>input type="range"</code> polyfill is updated. <strong>Note:</strong> This event will only be triggered if the polyfill is loaded. The polyfill will not load for browsers with native <code>input type="range"</code> support.</td>
				<td>Used to identify where the <code>input type="range"</code> polyfill initialized (target of the event)
					<pre><code>$( document ).on( "wb-updated.wb-slider", "input[type='range']", function( event ) {
});</code></pre>
					<pre><code>$( "input[type='range']" ).on( "wb-updated.wb-slider", function( event ) {
});</code></pre>
				</td>
			</tr>
			<tr>
				<td><code>wb-ready.wb</code> (v4.0.5+)</td>
				<td>Triggered automatically when WET has finished loading and executing.</td>
				<td>Used to identify when all WET plugins and polyfills have finished loading and executing.
					<pre><code>$( document ).on( "wb-ready.wb", function( event ) {
});</code></pre>
				</td>
			</tr>
		</tbody>
	</table>
</section>

<section>
	<h2>Source code</h2>
	<p><a href="https://github.com/wet-boew/wet-boew/tree/master/src/polyfills/slider">Input type="range" polyfill source code on GitHub</a></p>
</section>
