beautypg.com

Dom.hashorizontalguide(), Dom.hasverticalguide() – Adobe Dreamweaver API Reference CS5 User Manual

Page 434

background image

429

DREAMWEAVER API REFERENCE

Design

Last updated 8/27/2013

Example
The following example deletes all guides in the document if the document has at least one guide:

var currentDOM = dw.getDocumentDOM();

if (currentDOM.hasGuides() == true) {
currentDOM.clearGuides();

}

dom.hasHorizontalGuide()

Availability
Dreamweaver 8.

Description
This function determines whether the document has a horizontal guide at the specified location.

Arguments
location

The location argument is a string that represents the location in the document to test, with both the value and units
as one string, with no space between the value and units. The possible units are

"px"

for pixels and

"%"

for

percentage. For example, to specify 10 pixels,

location = "10px"

; to specify 50 percent,

location = "50%"

.

Returns
A Boolean value:

true

if there is a horizontal guide at the location;

false

otherwise.

Example
The following example deletes all guides in the document if the document has a horizontal guide at the specified
location:

var currentDOM = dw.getDocumentDOM();

if (currentDOM.hasHorizontalGuide("10px") == true) {

currentDOM.clearGuides();

}

dom.hasVerticalGuide()

Availability
Dreamweaver 8.

Description
This function determines whether the document has a vertical guide at the current location.

Arguments
location

The location argument is a string that represents the location in the document to test, with both the value and units
as one string, with no space between the value and units. The possible units are

"px"

for pixels and

"%"

for

percentage. For example, to specify 10 pixels,

location = "10px"

; to specify 50 percent,

location = "50%"

.