JavaScript Reference/Javascript Properties/layerX

Материал из Web эксперт
Перейти к: навигация, поиск

"layerX" Example

   <source lang="javascript">
   

<html> <body> <script> function function1(myEvent) {

  document.getElementById("myX").innerHTML = myEvent.layerX;
  document.getElementById("myY").innerHTML = myEvent.layerY; 

} document.onmousemove = function1; </script>

Layer X Coordinate: 0

Layer Y Coordinate: 0

<button onclick="alert(event.type);">Event Type</button> </body> </html>


     </source>
   
  


"layerX" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |event | +----------------+--------------------------------------------------------------+

     </source>
   
  


"layerX" Syntax and Note

   <source lang="javascript">

Note: Read-only property. Set either the cursor"s X coordinate or the object width which triggers the onResize event.

Syntax:

window.event.layerX eventName.layerX


     </source>