JavaScript - Tutorial - Objektreferenz - Das style-Objekt

Diese style-Objektreferenz befindet sich nur noch der Vollständigkeit halber in diesem Tutorial.
Die style-Objektreferenz nach CSS findet man im Anhang A plus.


window
document
all
style

style ist ein Objekt, welches alle im all-Objekt aufgezählten Unterobjekte besitzen. Es enthält alle Information über Position, Größe, Textstil, Farben, Hintergrundbilder der einzelnen Seitenelemente. Im Netscape Navigator 4 ist es nicht verfügbar. Einige Attributen befinden sich im Netscape Navigator 4 statt an der Stelle document.all.object.style.attribute in der Hierarchie an der Stelle document.object.attribute oder sie fehlen.

Bei der Benutzung folgender Attribute sollte man Vorsicht walten lassen, da sie nicht von jedem Browser unterstützt werden oder teilweise nicht verändert werden dürfen.
Dies ist eine Liste, welche die automatische Objektauflistung (Anhang B) im MS Internet Explorer 5.00 lieferte.

Attribute des Objekts style
Attribut Typ
acceleratorstring
backgroundstring
backgroundAttachmentstring
backgroundColorstring
backgroundImagestring
backgroundPositionstring
backgroundPositionXstring
backgroundPositionYstring
backgroundRepeatstring
behaviorstring
borderstring
borderBottomstring
borderBottomColorstring
borderBottomStylestring
borderBottomWidthstring
borderCollapsestring
borderColorstring
borderLeftstring
borderLeftColorstring
borderLeftStylestring
borderLeftWidthstring
borderRightstring
borderRightColorstring
borderRightStylestring
borderRightWidthstring
borderStylestring
borderTopstring
borderTopColorstring
borderTopStylestring
borderTopWidthstring
borderWidthstring
bottomstring
clearstring
clipstring
colorstring
cssTextstring
cursorstring
directionstring
displaystring
filterstring
fontstring
fontFamilystring
fontSizestring
fontStylestring
fontVariantstring
fontWeightstring
heightstring
imeModestring
layoutGridstring
layoutGridCharstring
layoutGridLinestring
layoutGridModestring
layoutGridTypestring
leftstring
letterSpacingstring
lineBreakstring
lineHeightstring
listStylestring
listStyleImagestring
listStylePositionstring
listStyleTypestring
marginstring
marginBottomstring
marginLeftstring
marginRightstring
marginTopstring
overflowstring
overflowXstring
overflowYstring
paddingstring
paddingBottomstring
paddingLeftstring
paddingRightstring
paddingTopstring
pageBreakAfterstring
pageBreakBeforestring
posBottomnumber
posHeightnumber
positionstring
posLeftnumber
posRightnumber
posTopnumber
posWidthnumber
rightstring
rubyAlignstring
rubyOverhangstring
rubyPositionstring
styleFloatstring
tableLayoutstring
textAlignstring
textAutospacestring
textDecorationstring
textDecorationBlinkboolean
textDecorationLineThroughboolean
textDecorationNoneboolean
textDecorationOverlineboolean
textDecorationUnderlineboolean
textIndentstring
textJustifystring
textJustifyTrimstring
textKashidastring
textTransformstring
topstring
unicodeBidistring
verticalAlignstring
visibilitystring
whiteSpacestring
widthstring
wordBreakstring
wordSpacingstring
zIndexnumber


Funktionen des Objekts style
Funktion Bedeutung
getAttribute(name,mode) Gibt den Wert eines Attributes zurück
name: Attributname
mode: true wenn nach Groß-und Kleinschreibung unterschieden werden soll
removeAttribute(name,mode) entfernt ein Attribut
name: Attributname
mode: true wenn nach Groß-und Kleinschreibung unterschieden werden soll
setAttribute(name,value,mode) setzt den Wert eines Attributes
name: Attributname
value: Attributwert
mode: true wenn nach Groß-und Kleinschreibung unterschieden werden soll


Benutzung des style-Objekts


Die Benutzung wird in der Dokumentation zum all-Objekt mit beschrieben.

Ein Funktionsbeispiel findet sich im Anhang C.

Autor: Ulrich Kritzner