JavaScript - Tutorial - Objektreferenz - Das style-Objekt
|
|
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 |
accelerator | | string |
background | | string |
backgroundAttachment | | string |
backgroundColor | | string |
backgroundImage | | string |
backgroundPosition | | string |
backgroundPositionX | | string |
backgroundPositionY | | string |
backgroundRepeat | | string |
behavior | | string |
border | | string |
borderBottom | | string |
borderBottomColor | | string |
borderBottomStyle | | string |
borderBottomWidth | | string |
borderCollapse | | string |
borderColor | | string |
borderLeft | | string |
borderLeftColor | | string |
borderLeftStyle | | string |
borderLeftWidth | | string |
borderRight | | string |
borderRightColor | | string |
borderRightStyle | | string |
borderRightWidth | | string |
borderStyle | | string |
borderTop | | string |
borderTopColor | | string |
borderTopStyle | | string |
borderTopWidth | | string |
borderWidth | | string |
bottom | | string |
clear | | string |
clip | | string |
color | | string |
cssText | | string |
cursor | | string |
direction | | string |
display | | string |
filter | | string |
font | | string |
fontFamily | | string |
fontSize | | string |
fontStyle | | string |
fontVariant | | string |
fontWeight | | string |
height | | string |
imeMode | | string |
layoutGrid | | string |
layoutGridChar | | string |
layoutGridLine | | string |
layoutGridMode | | string |
layoutGridType | | string |
left | | string |
letterSpacing | | string |
lineBreak | | string |
lineHeight | | string |
listStyle | | string |
listStyleImage | | string |
listStylePosition | | string |
listStyleType | | string |
margin | | string |
marginBottom | | string |
marginLeft | | string |
marginRight | | string |
marginTop | | string |
overflow | | string |
overflowX | | string |
overflowY | | string |
padding | | string |
paddingBottom | | string |
paddingLeft | | string |
paddingRight | | string |
paddingTop | | string |
pageBreakAfter | | string |
pageBreakBefore | | string |
posBottom | | number |
posHeight | | number |
position | | string |
posLeft | | number |
posRight | | number |
posTop | | number |
posWidth | | number |
right | | string |
rubyAlign | | string |
rubyOverhang | | string |
rubyPosition | | string |
styleFloat | | string |
tableLayout | | string |
textAlign | | string |
textAutospace | | string |
textDecoration | | string |
textDecorationBlink | | boolean |
textDecorationLineThrough | | boolean |
textDecorationNone | | boolean |
textDecorationOverline | | boolean |
textDecorationUnderline | | boolean |
textIndent | | string |
textJustify | | string |
textJustifyTrim | | string |
textKashida | | string |
textTransform | | string |
top | | string |
unicodeBidi | | string |
verticalAlign | | string |
visibility | | string |
whiteSpace | | string |
width | | string |
wordBreak | | string |
wordSpacing | | string |
zIndex | | number |
|
|
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
|