javascript - get position from specific position to end window -
Hello how can I get the status (browser) dynamic to end the window with a specific status < / Div>
First of all, you can hook the mouseMove event to html. After that, you close the window when the position of the mouse in the specified range.
Here is a simple example for you: windows are automatically close when the mouse moves to the limit of 100 < X & LT; 105 & 100 & lt; Y & lt; 105.
& lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Title & gt; Close Windows & lt; / Title & gt; & Lt; Script type = "text / javascript" & gt; Function checkpost () {var s = 'X =' + window.event.clientX + 'Y =' + window Event.clientY; Document.getElementById ('divCoord'). InnerText = s; If (window.event.clientX & gt; 100 & amp; amp; amp; window; Event.CustomX & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; Events · Clafty Y & gt; 100 & amp; . Event.quality & lt; 105) {window.close}; }} & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body onmousemove = checkPos () & gt; & Lt; Div id = "divCoord" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
Comments
Post a Comment