Sabtu, 23 Agustus 2025

DHTML - runtimeStyle

 

runtimeStyle Object


Represents the cascaded format and style of the object that overrides the format and style specified in global style sheets, inline styles, and HTML attributes.

Remarks

The runtimeStyle object sets and retrieves the format and style of an object, and overrides existing formats and styles in the process. Other than having precedence over the style object and not persisting, the runtimeStyle object is equivalent to the style object.

PropertyDescription
onOffBehaviorRetrieves an object indicating whether the specified Microsoft® DirectAnimation® behavior is running.
Filter PropertyDescription
AlphaAdjusts the opacity of the content of the object.
BlendTransReveals new content of the object by fading the original content.
ChromaDisplays a specific color of the content of the object as transparent.
DropShadowCreates a solid silhouette of the content of the object, offset in the specified direction. This creates the illusion that the content is floating and casting a shadow.
FlipHDisplays the content of the object flipped across the horizontal axis.
FlipVDisplays the content of the object flipped across the vertical axis.
GlowAdds radiance around the outside edges of the content of the object so that it appears to glow.
GrayDisplays the content of the object in grayscale.
InvertReverses the hue, saturation, and brightness values of the content of the object.
LightCreates the effect of a light shining on the content of the object.
MaskFilterDisplays transparent pixels of the object content as a color mask, and makes the nontransparent pixels transparent.
MotionBlurCauses the content of the object to appear to be in motion.
RedirectNot currently supported.
RevealTransReveals new content of the object using one of 24 predefined Transition effects.
ShadowCreates a solid silhouette of the content of the object, offset in the specified direction. This creates the illusion of a shadow.
WavePerforms a sine wave distortion of the content of the object along the vertical axis.
XrayChanges the color depth of the content of the object and displays it in black and white.
MethodDescription
getAttributeRetrieves the value of the specified attribute.
getExpressionRetrieves the expression for the given property.
removeAttributeRemoves the given attribute from the object.
removeExpressionRemoves the expression from the specified property.
setAttributeSets the value of the specified attribute.
setExpressionSets an expression for the specified object.
Style AttributeStyle PropertyDescription
ACCELERATORacceleratorSets or retrieves a string that indicates whether the object contains an accelerator key.
backgroundbackgroundSets or retrieves up to five separate background properties of the object.
background-attachmentbackgroundAttachmentSets or retrieves how the background image is attached to the object within the document.
background-colorbackgroundColorSets or retrieves the color behind the content of the object.
background-imagebackgroundImageSets or retrieves the background image of the object.
background-positionbackgroundPositionSets or retrieves the position of the background of the object.
background-position-xbackgroundPositionXSets or retrieves the x-coordinate of the backgroundPosition property.
background-position-ybackgroundPositionYSets or retrieves the y-coordinate of the backgroundPosition property.
background-repeatbackgroundRepeatSets or retrieves how the backgroundImage property of the object is tiled.
behaviorbehaviorSets or retrieves the location of the DHTML Behaviors.
borderborderSets or retrieves the properties to draw around the object.
border-bottomborderBottomSets or retrieves the properties of the bottom border of the object.
border-bottom-colorborderBottomColorSets or retrieves the color of the bottom border of the object.
border-bottom-styleborderBottomStyleSets or retrieves the style of the bottom border of the object.
border-bottom-widthborderBottomWidthSets or retrieves the width of the bottom border of the object.
border-collapseborderCollapseSets or retrieves a value that indicates whether the row and cell borders of a table are joined in a single border or detached as in standard HTML.
border-colorborderColorSets or retrieves the border color of the object.
border-leftborderLeftSets or retrieves the properties of the left border of the object.
border-left-colorborderLeftColorSets or retrieves the color of the left border of the object.
border-left-styleborderLeftStyleSets or retrieves the style of the left border of the object.
border-left-widthborderLeftWidthSets or retrieves the width of the left border of the object.
border-rightborderRightSets or retrieves the properties of the right border of the object.
border-right-colorborderRightColorSets or retrieves the color of the right border of the object.
border-right-styleborderRightStyleSets or retrieves the style of the right border of the object.
border-right-widthborderRightWidthSets or retrieves the width of the right border of the object.
border-styleborderStyleSets or retrieves the style of the left, right, top, and bottom borders of the object.
border-topborderTopSets or retrieves the properties of the top border of the object.
border-top-colorborderTopColorSets or retrieves the color of the top border of the object.
border-top-styleborderTopStyleSets or retrieves the style of the top border of the object.
border-top-widthborderTopWidthSets or retrieves the width of the top border of the object.
border-widthborderWidthSets or retrieves the width of the left, right, top, and bottom borders of the object.
bottombottomSets or retrieves the bottom position of the object in relation to the bottom of the next positioned object in the document hierarchy.
clearclearSets or retrieves whether the object allows floating objects on its left side, right side, or both, so that the next text displays past the floating objects.
clipclipSets or retrieves which part of a positioned object is visible.
colorcolorSets or retrieves the color of the text of the object.
cssTextSets or retrieves the persisted representation of the style rule.
cursorcursorSets or retrieves the type of cursor to display as the mouse pointer moves over the object.
directiondirectionSets or retrieves the reading order of the object.
fontfontSets or retrieves up to six separate font properties of the object.
font-familyfontFamilySets or retrieves the name of the font used for text in the object.
font-sizefontSizeSets or retrieves the size of the font used for text in the object.
font-stylefontStyleSets or retrieves the font style of the object as italicnormal, or oblique.
font-variantfontVariantSets or retrieves whether the text of the object is in small capital letters.
font-weightfontWeightSets or retrieves the weight of the font of the object.
heightheightSets or retrieves the height of the object.
ime-modeimeModeSets or retrieves the state of an Input Method Editor (IME).
layout-flowlayoutFlowSets or retrieves the direction and flow of the content in the object.
layout-gridlayoutGridSets or retrieves the composite document grid properties that specify the layout of text characters.
layout-grid-charlayoutGridCharSets or retrieves the size of the character grid used for rendering the text content of an element.
layout-grid-linelayoutGridLineSets or retrieves the gridline value used for rendering the text content of an element.
layout-grid-modelayoutGridModeSets or retrieves whether the text layout grid uses two dimensions.
layout-grid-typelayoutGridTypeSets or retrieves the type of grid used for rendering the text content of an element.
leftleftSets or retrieves the position of the object relative to the left edge of the next positioned object in the document hierarchy.
letter-spacingletterSpacingSets or retrieves the amount of additional space between letters in the object.
line-breaklineBreakSets or retrieves line-breaking rules for Japanese text.
line-heightlineHeightSets or retrieves the distance between lines in the object.
list-stylelistStyleSets or retrieves up to three separate listStyle properties of the object.
list-style-imagelistStyleImageSets or retrieves which image to use as a list-item marker for the object.
list-style-positionlistStylePositionSets or retrieves how the list-item marker is drawn relative to the content of the object.
list-style-typelistStyleTypeSets or retrieves the predefined type of the line-item marker for the object.
marginmarginSets or retrieves the width of the top, right, bottom, and left margins of the object.
margin-bottommarginBottomSets or retrieves the height of the bottom margin of the object.
margin-leftmarginLeftSets or retrieves the width of the left margin of the object.
margin-rightmarginRightSets or retrieves the width of the right margin of the object.
margin-topmarginTopSets or retrieves the height of the top margin of the object.
min-heightminHeightSets or retrieves the minimum height for an element.
overflowoverflowSets or retrieves a value indicating how to manage the content of the object when the content exceeds the height or width of the object.
overflow-xoverflowXSets or retrieves how to manage the content of the object when the content exceeds the width of the object.
overflow-yoverflowYSets or retrieves how to manage the content of the object when the content exceeds the height of the object.
paddingpaddingSets or retrieves the amount of space to insert between the object and its margin or, if there is a border, between the object and its border.
padding-bottompaddingBottomSets or retrieves the amount of space to insert between the bottom border of the object and the content.
padding-leftpaddingLeftSets or retrieves the amount of space to insert between the left border of the object and the content.
padding-rightpaddingRightSets or retrieves the amount of space to insert between the right border of the object and the content.
padding-toppaddingTopSets or retrieves the amount of space to insert between the top border of the object and the content.
page-break-afterpageBreakAfterSets or retrieves a value indicating whether a page break occurs after the object.
page-break-beforepageBreakBeforeSets or retrieves a string indicating whether a page break occurs before the object.
pixelBottomSets or retrieves the bottom position of the object.
pixelHeightSets or retrieves the height of the object.
pixelLeftSets or retrieves the left position of the object.
pixelRightSets or retrieves the right position of the object.
pixelTopSets or retrieves the top position of the object.
pixelWidthSets or retrieves the width of the object.
posBottomSets or retrieves the bottom position of the object in the units specified by the bottom attribute.
posHeightSets or retrieves the height of the object in the units specified by the height attribute.
positionpositionSets or retrieves the type of positioning used for the object.
posLeftSets or retrieves the left position of the object in the units specified by the left attribute.
posRightSets or retrieves the right position of the object in the units specified by the right attribute.
posTopSets or retrieves the top position of the object in the units specified by the top attribute.
posWidthSets or retrieves the width of the object in the units specified by the width attribute.
rightrightSets or retrieves the position of the object relative to the right edge of the next positioned object in the document hierarchy.
ruby-alignrubyAlignSets or retrieves the position of the ruby text specified by the rt object.
ruby-overhangrubyOverhangSets or retrieves the position of the ruby text specified by the rt object.
ruby-positionrubyPositionSets or retrieves the position of the ruby text specified by the rt object.
scrollbar-3dlight-colorscrollbar3dLightColorSets or retrieves the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
scrollbar-arrow-colorscrollbarArrowColorSets or retrieves the color of the arrow elements of a scroll arrow.
scrollbar-base-colorscrollbarBaseColorSets or retrieves the color of the main elements of a scroll bar, which include the scroll box, track, and scroll arrows.
scrollbar-darkshadow-colorscrollbarDarkShadowColorSets or retrieves the color of the gutter of a scroll bar.
scrollbar-face-colorscrollbarFaceColorSets or retrieves the color of the scroll box and scroll arrows of a scroll bar.
scrollbar-highlight-colorscrollbarHighlightColorSets or retrieves the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.
scrollbar-shadow-colorscrollbarShadowColorSets or retrieves the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.
scrollbar-track-colorscrollbarTrackColorSets or retrieves the color of the track element of a scroll bar.
floatstyleFloatSets or retrieves on which side of the object the text will flow.
table-layouttableLayoutSets or retrieves a string that indicates whether the table layout is fixed.
text-aligntextAlignSets or retrieves whether the text in the object is left-aligned, right-aligned, centered, or justified.
text-align-lasttextAlignLastSets or retrieves how to align the last line or only line of text in the object.
text-autospacetextAutospaceSets or retrieves the autospacing and narrow space width adjustment of text.
text-decorationtextDecorationSets or retrieves whether the text in the object has blink, line-through, overline, or underline decorations.
textDecorationBlinkSets or retrieves a Boolean value that indicates whether the object's textDecoration property has a value of "blink."
textDecorationLineThroughSets or retrieves a Boolean value indicating whether the text in the object has a line drawn through it.
textDecorationNoneSets or retrieves the Boolean value indicating whether the textDecoration property for the object has been set to none.
textDecorationOverlineSets or retrieves a Boolean value indicating whether the text in the object has a line drawn over it.
textDecorationUnderlineSets or retrieves whether the text in the object is underlined.
text-indenttextIndentSets or retrieves the indentation of the first line of text in the object.
text-justifytextJustifySets or retrieves the type of alignment used to justify text in the object.
text-kashida-spacetextKashidaSpaceSets or retrieves the ratio of kashida expansion to white space expansion when justifying lines of text in the object.
text-overflowtextOverflowSets or retrieves a value that indicates whether to render ellipses(...) to indicate text overflow.
text-transformtextTransformSets or retrieves the rendering of the text in the object.
text-underline-positiontextUnderlinePositionSets or retrieves the position of the underline decoration that is set through the textDecoration property of the object.
toptopSets or retrieves the position of the object relative to the top of the next positioned object in the document hierarchy.
unicode-bidiunicodeBidiSets or retrieves the level of embedding with respect to the bidirectional algorithm.
vertical-alignverticalAlignSets or retrieves the vertical alignment of the object.
visibilityvisibilitySets or retrieves whether the content of the object is displayed.
widthwidthSets or retrieves the width of the object.
word-breakwordBreakSets or retrieves line-breaking behavior within words, particularly where multiple languages appear in the object.
word-spacingwordSpacingSets or retrieves the amount of additional space between words in the object.
word-wrapwordWrapSets or retrieves whether to break words when the content exceeds the boundaries of its container.
writing-modewritingModeSets or retrieves the direction and flow of the content in the object.
z-indexzIndexSets or retrieves the stacking order of positioned objects.
zoomzoomSets or retrieves the magnification scale of the object.

Example

This example sets a value on the runtimeStyle object to affect the currentStyle object, but not the style object.

<SCRIPT>
function fnChangeValue(sValue){
   if(oDIV.runtimeStyle.backgroundColor == oDIV.style.backgroundColor){
      sValue="";
   }
   oDIV.runtimeStyle.backgroundColor = sValue;
   alert(oDIV.style.backgroundColor +
      "\n" + oDIV.currentStyle.backgroundColor +
      "\n" + oDIV.runtimeStyle.backgroundColor);
}
</SCRIPT>

<DIV ID = "oDIV">
This is a demonstration DIV.
</DIV>

<INPUT TYPE = "button" VALUE = "Change Color" onclick="fnChangeValue('blue')">
This feature requires Microsoft® Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this object.

Applies To

AACRONYMADDRESSAPPLETBBIGBLOCKQUOTEBODYBRBUTTONCAPTIONCENTERCITECODECOLCOLGROUPCUSTOMDDDELDFNDIRDIVDLDTEMEMBEDFIELDSETFONTFORMFRAMEFRAMESETHnHRHTMLIIFRAMEIMGINPUT type=buttonINPUT type=checkboxINPUT type=fileINPUT type=hiddenINPUT type=imageINPUT type=passwordINPUT type=radioINPUT type=resetINPUT type=submitINPUT type=textINSKBDLABELLEGENDLILISTINGMARQUEEMENUNOBROBJECTOLOPTIONPPLAINTEXTPREQSSAMPSELECTSMALLSPANSTRIKESTRONGSUBSUPTABLETBODYTDTEXTAREATFOOTTHTHEADTRTTUULVARXMP

See Also

currentStyle

Tidak ada komentar: