JavaScript Reference/Javascript Methods/moveToPoint — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
"moveToPoint()" Example
<html>
<body>
<script language="JavaScript">
function function1(){
var range = document.body.createTextRange();
var myX = window.event.clientX;
var myY = window.event.clientY;
range.moveToPoint(myX, myY);
range.expand("sentence");
range.select();}
</script>
<body onclick="function1();">Sample text range, click here</body>
</body>
</html>
"moveToPoint()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |TextRange |
+----------------+--------------------------------------------------------------+
"moveToPoint()" Syntax, Parameters and Note
Note:
Compacts the text and moves the empty text range.
Syntax:
textRangeName.moveToPoint(param1, param2)
Parameters:
param1 Required; the X coordinate of the point.
param2 Required; the Y coordinate of the point.