文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Anchor
Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated.
Constructors
new Anchor(Document doc, Number row, Number column)
Creates a new Anchor
and associates it with a document.
doc | Document | Required. The document to associate with the anchor |
row | Number | Required. The starting row position |
column | Number | Required. The starting column position |
Events
Anchor.on("change", function(Object e))
Fires whenever the anchor position changes.
Both of these objects have a row
and column
property corresponding to the position.
Events that can trigger this function include setPosition()
.
e | Object | Required. An object containing information about the anchor position. It has two properties:
|
Methods
Anchor.detach()
When called, the 'change'
event listener is removed.
Anchor.getDocument()
返回值: Document
Returns the current document.
Anchor.getPosition()
返回值: Object
Returns an object identifying the row
and column
position of the current anchor.
Anchor.onChange()
Undocumented
Anchor.setPosition(Number row, Number column, Boolean noClip)
Sets the anchor position to the specified row and column. If noClip
is true
, the position is not clipped.
row | Number | Required. The row index to move the anchor to |
column | Number | Required. The column index to move the anchor to |
noClip | Boolean | Required. Identifies if you want the position to be clipped |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论