---
{
	"title": "Correctif « meter » (compteur)",
	"language": "fr",
	"category": "Correctifs",
	"categoryfile": "polyfills",
	"description": "Émule l’élément « meter » pour les navigateurs qui ne le supportent pas. L'élément « meter » affiche une mesure scalaire dans une gamme connue.",
	"altLangPrefix": "meter",
	"dateModified": "2014-08-04"
}
---
<span class="wb-prettify all-pre hide"></span>

<section>
	<h2>But</h2>
	<p>L'élément «&#160;<code>meter</code>&#160;» de HTML5 affiche une mesure scalaire dans une gamme connue. Étant donné que certains navigateurs ne prennent pas en charge cette fonctionnalité à l'origine, ce correctif émule la même fonctionnalité en utilisant HTML générique et WAI-ARIA.</p>
</section>

<div lang="en">
<p><strong>Needs translation</strong></p>
<section>
	<h2>Use when</h2>
	<ul>
		<li>Displaying a scalar measurement within a known range</li>
	</ul>
</section>

<section>
	<h2>Do not use when</h2>
	<ul>
		<li>Displaying the progress of a task</li>
	</ul>
</section>

<section>
	<h2>Working example</h2>
	<section>
		<h3>Normal</h3>
		<pre><code>&lt;meter min="20" value="65" max="80"&gt;75% (normal)&lt;/meter&gt;</code></pre>
	</section>
	<section>
		<h3>Too high</h3>
		<pre><code>&lt;meter min="0" value="90" max="100" high="80"&gt;90% (too high)&lt;/meter&gt;</code></pre>
	</section>
	<section>
		<h3>Too low</h3>
		<pre><code>&lt;meter min="100" low="120" value="115" max="200" high="180"&gt;15% (too low)&lt;/meter&gt;</code></pre>
	</section>

	<ul>
		<li><a href="../../../demos/meter/meter-en.html">English examples</a></li>
		<li><a href="../../../demos/meter/meter-fr.html">French examples</a></li>
	</ul>
</section>

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

<section>
	<h2>Configuration options</h2>
	<p><a rel="external" href="https://www.w3.org/TR/html5/forms.html#the-meter-element">Configuration options available for the <code>meter</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-meter</code></td>
				<td>Triggered manually (e.g., <code>$( "meter" ).trigger( "wb-init.wb-meter" );</code>).</td>
				<td>Used to manually initialize the <code>meter</code> polyfill. <strong>Note:</strong> The <code>meter</code> polyfill will be initialized automatically unless the <code>meter</code> element is added after the page has already loaded.</td>
			</tr>
			<tr>
				<td><code>wb-update.wb-meter</code></td>
				<td>Triggered manually (e.g., <code>$( "meter" ).trigger( "wb-update.wb-meter" );</code>).</td>
				<td>Used to manually update the <code>meter</code> polyfill.</td>
			</tr>
			<tr>
				<td><code>wb-ready.wb-meter</code> (v4.0.5+)</td>
				<td>Triggered automatically after the <code>meter</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>meter</code> support.</td>
				<td>Used to identify where the <code>meter</code> polyfill initialized (target of the event)
					<pre><code>$( document ).on( "wb-ready.wb-meter", "meter", function( event ) {
});</code></pre>
					<pre><code>$( "meter" ).on( "wb-ready.wb-meter", function( event ) {
});</code></pre>
				</td>
			</tr>
			<tr>
				<td><code>wb-updated.wb-meter</code> (v4.0.5+)</td>
				<td>Triggered automatically after the <code>meter</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>meter</code> support.</td>
				<td>Used to identify where the <code>meter</code> polyfill initialized (target of the event)
					<pre><code>$( document ).on( "wb-updated.wb-meter", "meter", function( event ) {
});</code></pre>
					<pre><code>$( "meter" ).on( "wb-updated.wb-meter", 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/meter">Meter polyfill source code on GitHub</a></p>Ù
</section>
</div>
