aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/mouseevent/clientx/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/api/mouseevent/clientx/index.html')
-rw-r--r--files/pt-br/web/api/mouseevent/clientx/index.html149
1 files changed, 149 insertions, 0 deletions
diff --git a/files/pt-br/web/api/mouseevent/clientx/index.html b/files/pt-br/web/api/mouseevent/clientx/index.html
new file mode 100644
index 0000000000..efeb585203
--- /dev/null
+++ b/files/pt-br/web/api/mouseevent/clientx/index.html
@@ -0,0 +1,149 @@
+---
+title: MouseEvent.clientX
+slug: Web/API/MouseEvent/clientX
+translation_of: Web/API/MouseEvent/clientX
+---
+<p>{{APIRef("DOM Events")}}</p>
+
+<p>O <strong><code>clientX</code></strong> é uma propriedade somente de leitura da interface {{domxref("MouseEvent")}} que fornece as coordenadas horizontais dentro da área do aplicativo do cliente em que o evento ocorreu (diferente das coordenadas dentro da página). Por exemplo, clicando no canto superior esquerdo da área do cliente sempre irá resultar em um evento de mouse com um valor <code>clientX</code> de 0, independentemente se a página foi rolada horizontalmente. Originalmente, essa propriedade era definida como o número inteiro <code>long</code>. O Módulo de Visualização CSSOM o redefiniu como a fração<code>double</code>. Veja a seção de compatibilidade do Navegador para detalhes.</p>
+
+<h2 id="Sintaxe">Sintaxe</h2>
+
+<pre class="syntaxbox">var <em>x</em> = <em>instanceOfMouseEvent</em>.clientX
+</pre>
+
+<h3 id="Valor_de_retorno">Valor de retorno</h3>
+
+<p>Um número</p>
+
+<h2 id="Example" name="Example">Exemplo</h2>
+
+<pre class="brush:html">&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+ &lt;title&gt;clientX/clientY example&lt;/title&gt;
+
+ &lt;script&gt;
+ function showCoords(evt){
+ alert(
+ "clientX value: " + evt.clientX + "\n" +
+ "clientY value: " + evt.clientY + "\n"
+ );
+ }
+ &lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body onmousedown="showCoords(event)"&gt;
+ &lt;p&gt;Para mostrar as coordenadas do mouse em qualquer lugar da página.&lt;/p&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSSOM View','#dom-mouseevent-clientx', 'clientX')}}</td>
+ <td>{{Spec2('CSSOM View')}}</td>
+ <td>Redefine {{domxref("MouseEvent")}} de<code>long</code> para <code>double</code>. </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM3 Events','#widl-MouseEvent-clientX','MouseEvent.clientX')}}</td>
+ <td>{{Spec2('DOM3 Events')}}</td>
+ <td>Nenhuma mudança de {{SpecName('DOM2 Events')}}.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Events','#Events-MouseEvent','MouseEvent.clientX')}}</td>
+ <td>{{Spec2('DOM2 Events')}}</td>
+ <td>Definição inicial.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilidade com Navegadores</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Suporte básico</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ <td>6</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ </tr>
+ <tr>
+ <td>Redefinido de <code>long</code> para <code>double</code></td>
+ <td>{{CompatChrome(56)}}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Suporte básico</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td>Redefinido de <code>long</code> para <code>double</code></td>
+ <td>{{CompatChrome(56)}}</td>
+ <td>{{CompatChrome(56)}}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also" name="See_also">Veja também</h2>
+
+<ul>
+ <li>{{ domxref("MouseEvent") }}</li>
+ <li>{{domxref("MouseEvent.clientY","clientY")}}</li>
+ <li>{{domxref("MouseEvent.screenX","screenX")}} / {{domxref("MouseEvent.screenY","screenY")}}</li>
+</ul>