JS 바인딩 이벤트의 일반적인 방법에 대한 간단한 분석
<? xml version = "1.0"encoding = "utf-8"?> <! doctype html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w3.org/xhtml1/dtd/xhtml1-transital.dtd"> xmlns = "http://www.w3.org/1999/xhtml"> <head> <head> <meta http-equiv = "content-type"content = "text/html; charset = utf-8"/<title> js 이벤트 바인딩 </title> <script type = "text/javascript">************** htections with with 속성* 장점 : 1 : 동작의 분리를 완료* 2 : 파티 객체를 쉽게 조작하기 쉽습니다. 함수는 on *** 속성으로 나타나기 때문에 파티 객체를 직접 참조 할 수 있습니다. * 3 : 이벤트 개체를 읽는 것이 편리합니다. 이벤트가 트리거되면 시스템은 이벤트 객체를 이벤트 기능으로 자동 전달합니다. 그중 하나는 전달됩니다*/ wind jj.style.top = event.clientx+'px'; jj.style.left = event.clienty+'px'; }} </script> <tyle> #k {너비 : 60px; 높이 : 80px; 배경색 :#80ffff;}#jj {width : 60px; 높이 : 80px; 배경색; 배경 색 :#ffff00; z-index : 1000; 위치 : 절대;} </style> </head> <body> <div id = "k"> </div> <div id = "jj"> </div> </html>위의 기사는 JS 바인딩 이벤트의 일반적인 방법을 간략하게 분석합니다. 나는 당신이 당신에게 참조를 줄 수 있기를 바랍니다. 그리고 당신이 wulin.com을 더 지원할 수 있기를 바랍니다.