Adobe Dreamweaver API Reference CS5 Uživatelský manuál Strana 344

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 533
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 343
339
DREAMWEAVER API REFERENCE
Page content
Last updated 8/27/2013
Description
Gets the CSS styles that are declared for the specified element. Differs from the getComputedStyle() function in 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
bGetInherited is false (default case), getDeclaredStyle() also
gets only the styles that directly apply to the element; it does not include styles that are inherited from a parent.
Arguments
elt, pseudoElt, psuedoClassList, bGetInherited
elt - a node in the document whose style information is desired
pseudoElt - the CSS pseudoelement, or null if there is none
psuedoClassList - an optional string consisting of a space-separated list of pseudoclasses
bGetInherited - an optional Boolean value indicating whether to include styles inherited from ancestors (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 dom.minDisplayWidth()
function returns is specified by using CSS.
Arguments
container
container is the containing element for which a minimum width is required.
Zobrazit stránku 343
1 2 ... 339 340 341 342 343 344 345 346 347 348 349 ... 532 533

Komentáře k této Příručce

Žádné komentáře