Adobe 38040334 - Dreamweaver CS3 User Manual page 312

Api reference
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

window.getDeclaredStyle()
Availability
Dreamweaver CS3.
Description
Gets the CSS styles that are declared for the specified element. Differs from the
that styles that are not specifically declared are undefined, and it gives actual length values as declared in the style
sheet (e.g., 20%, .8em) rather than computed pixel values. If
also gets only the styles that directly apply to the element; it does not include styles that are inherited from
Style()
a parent.
Arguments
elt, pseudoElt, psuedoClassList, bGetInherited
- a node in the document whose style information is desired
elt
- the CSS pseudoelement, or
pseudoElt
- an optional string consisting of a space-separated list of pseudoclasses
psuedoClassList
- an optional Boolean value indicating whether to include styles inherited from ancestors
bGetInherited
(defaults to
).
false
Returns
A read-only object containing style properties that can be accessed by name.
Example
var dom = dw.getDocumentDOM();
var myDiv = dom.getElementById('myDiv');
var props = window.getDeclaredStyle(myDiv);
var marleft = "";
var units = "";
if (typeof(props.marginLeft) != "undefined"){
marleft = props.marginLeft;
units = marleft.replace(/\d+/,""); // remove digits, leaving units
alert(units); // should show %, px, pt, em, etc.
}
else
alert("no margin-left property has been set for myDiv.");
dom.getMinDisplayWidth()
Availability
Dreamweaver CS3.
Description
Gets the minimum width required for a block-level container to display its entire contents.
Note: The actual width of the container could be smaller if a value less than the value that the
function returns is specified by using CSS.
Width()
Arguments
container
bGetInherited
if there is none
null
DREAMWEAVER CS3
function in
getComputedStyle()
is false (default case),
getDeclared-
dom.minDisplay-
307
API Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents