Selection.extend()
Experimental
这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
Selection.extend()
方法移动选中区的焦点到指定的点。选中区的锚点不会移动。选中区将从锚点开始到新的焦点,不管方向。
语法
sel.extend(node, offset)
参数
- node
- 焦点会被移至此节点内。
- offset 可选
- 焦点会被移至
node
内的偏移位置。如果没有指定,使用0
作为默认值。
规范
Specification | Status | Comment |
---|---|---|
HTML Editing APIs Selection.extend() |
Editor's Draft | Initial definition |
Selection API Selection.extend() |
Working Draft | Current |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | 未实现 | (Yes) | (Yes) |
offset parameter is optional |
(Yes) | ? | 55 (55) | 未实现 | (Yes) | (Yes) |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | (Yes) | (Yes) | ? | ? | (Yes) |
offset parameter is optional |
? | ? | 55.0 (55) | ? | ? | (Yes) |
相关链接
Selection
, 此方法所属接口。