var offsets = dom.getSelection();
var theSelection = dreamweaver.offsetsToNode(offsets[0], ¬
offsets[1]);
if (theSelection.nodeType == Node.ELEMENT_NODE && ¬
theSelection.tagName == 'IMG'){
alert('The current selection is an image.');
}
dom.selectAll()
Availability
Dreamweaver 3.
Description
Performs a Select All operation.
Note: In most cases, this function selects all the content in the active document. In some cases (for example, when the
insertion point is inside a table), it selects only part of the active document. To set the selection to the entire document,
use
dom.setSelection()
Arguments
None.
Returns
Nothing.
dom.setSelectedNode()
Availability
Dreamweaver 3.
Description
Sets the selected node. This function is equivalent to calling the
return value to the
dom.setSelection()
Arguments
node, {bSelectInside}, {bJumpToNode}
• The
argument is a text, comment, or element node in the document.
node
• The
argument, which is optional, is a Boolean value that indicates whether to select the
bSelectInside
of the node. This argument is relevant only if
innterHTML
is omitted.
• The
argument, which is optional, is a Boolean value that indicates whether to scroll the Document
bJumpToNode
window, if necessary, to make the selection visible. If it is omitted, this argument defaults to
Returns
Nothing.
.
function.
dom.nodeToOffsets()
is an element node, and it defaults to
node
DREAMWEAVER CS3
API Reference
function and passing the
if it
false
.
false
258