blob: 313426bc83627c8c1527dd8de966885dbb8558f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
---
title: Selection.isCollapsed
slug: Web/API/Selection/isCollapsed
translation_of: Web/API/Selection/isCollapsed
---
<p>{{ ApiRef() }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<p>返回一个布尔值用于描述选区的起始点和终止点是否位于一个位置(即是否框选了,译者注)。</p>
<h3 id="Syntax" name="Syntax">用法</h3>
<pre class="eval"><i>sel</i>.isCollapsed
</pre>
<h3 id="Notes" name="Notes">注意</h3>
<p>即使是一个被折叠了的选区,其 rangeCount的结果也可能大于0。<span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: 1.5;">sel.getRangeAt(0)会在选区被折叠的情况下返回一个值。</span></p>
<div class="noinclude">
</div>
<p>{{ languages( { "es": "es/DOM/Selection/isCollapsed", "it": "it/DOM/Selection/isCollapsed", "pl": "pl/DOM/Selection/isCollapsed" } ) }}</p>
|