JavaScript Reference/Javascript Objects/runtimeStyle — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 08:22, 26 мая 2010

"runtimeStyle" CSS Attributes and JavaScript Style Properties

Names noted with an asterisk (*) are JavaScript properties only.
+----------------+--------------------------------------------------------------+
| CSS            |accelerator                     background                    |
| Attributes     |background-attachment           background-color              |
| and            |background-image                background-position           |
| JavaScript     |background-position-x           background-position-y         |
| Style          |background-repeat               behavior                      |
| Properties     |border                          border-bottom                 |
|                |border-bottom-color             border-bottom-style           |
|                |border-bottom-width             border-color                  |
|                |border-left                     border-left-color             |
|                |border-left-style               border-left-width             |
|                |border-right                    border-right-color            |
|                |border-right-style              border-right-width            |
|                |border-style                    border-top                    |
|                |border-top-color                border-top-style              |
|                |border-top-width                border-width                  |
|                |color                           cursor                        |
|                |direction                       display                       |
|                |filter                          font                          |
|                |font-family                     font-size                     |
|                |font-style                      font-variant                  |
|                |font-weight                     hasLayout(*)                  |
|                |layout-grid                     layout-grid-char              |
|                |layout-grid-line                layout-grid-mode              |
|                |layout-grid-type                letter-spacing                |
|                |line-break                      line-height                   |
|                |margin                          margin-bottom                 |
|                |margin-left                     margin-right                  |
|                |margin-top                      overflow                      |
|                |overflow-x                      overflow-y                    |
|                |padding                         padding-bottom                |
|                |padding-left                    padding-right                 |
|                |padding-top                     page-break-after              |
|                |page-break-before               pixelBottom(*)                |
|                |pixelHeight(*)                  pixelLeft(*)                  |
|                |pixelRight(*)                   pixelTop(*)                   |
|                |pixelWidth(*)                   posBottom(*)                  |
|                |posHeight(*)                    posLeft(*)                    |
|                |posRight(*)                     posTop(*)                     |
|                |posWidth(*)                     scrollbar-3dlight-color       |
|                |scrollbar-arrow-color           scrollbar-base-color          |
|                |scrollbar-darkshadow-color      scrollbar-face-color          |
|                |scrollbar-highlight-color       scrollbar-shadow-color        |
|                |scrollbar-track-color           text-align                    |
|                |text-align-last                 text-autospace                |
|                |text-decoration                 text-indent                   |
|                |text-justify                    text-kashida-space            |
|                |text-overflow                   text-transform                |
|                |text-underline-position         textDecorationBlink(*)        |
|                |textDecorationLineThrough(*)    textDecorationNone(*)         |
|                |textDecorationOverline(*)       textDecorationUnderline(*)    |
|                |unicode-bidi                    visibility                    |
|                |white-space                     word-break                    |
|                |word-spacing                    word-wrap                     |
|                |zoom                                                          |
+----------------+--------------------------------------------------------------+



"runtimeStyle" Example

    
<html>
<body>
<div id="myDiv" style="width:100; height:100;"></div>
<button onclick="myDiv.runtimeStyle.backgroundColor = "blue";">Change div color</button>
</body>
</html>



"runtimeStyle" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <acronym>                     |
|                |<address>                       <applet>                      |
|                |<b>                             <big>                         |
|                |<blockquote>                    <body>                        |
|                |<br>                            <button>                      |
|                |<caption>                       <center>                      |
|                |<cite>                          <code>                        |
|                |<col>                           <colgroup>                    |
|                |<custom>                        <dd>                          |
|                |<del>                           <dfn>                         |
|                |<dir>                           <div>                         |
|                |<dl>                            <dt>                          |
|                |<em>                            <embed>                       |
|                |<fieldset>                      <font>                        |
|                |<form>                          <frame>                       |
|                |<frameset>                      <hn>                          |
|                |<hr>                            <html>                        |
|                |<i>                             <iframe>                      |
|                |<img>                           <input type="button">         |
|                |<input type="checkbox">         <input type="file">           |
|                |<input type="hidden">           <input type="image">          |
|                |<input type="password">         <input type="radio">          |
|                |<input type="reset">            <input type="submit">         |
|                |<input type="text">             <ins>                         |
|                |<kbd>                           <label>                       |
|                |<legend>                        <li>                          |
|                |<listing>                       <marquee>                     |
|                |<menu>                          <nobr>                        |
|                |<object>                        <ol>                          |
|                |<option>                        <p>                           |
|                |<pre>                           <q>                           |
|                |<s>                             <samp>                        |
|                |<select>                        <small>                       |
|                |<span>                          <strike>                      |
|                |<strong>                        <sub>                         |
|                |<sup>                           <table>                       |
|                |<tbody>                         <td>                          |
|                |<textarea>                      <tfoot>                       |
|                |<th>                            <thead>                       |
|                |<tr>                            <tt>                          |
|                |<u>                             <ul>                          |
|                |<var>                           <xmp>                         |
+----------------+--------------------------------------------------------------+



"runtimeStyle" JavaScript Methods

+----------------+--------------------------------------------------------------+
| JavaScript     |getAttribute                    getExpression                 |
| Methods        |removeAttribute                 removeExpression              |
|                |setAttribute                    setExpression                 |
+----------------+--------------------------------------------------------------+



"runtimeStyle" JavaScript Properties

+----------------+--------------------------------------------------------------+
| JavaScript     |cssText                         onOffBehavior                 |
+----------------+--------------------------------------------------------------+



"runtimeStyle" Microsoft Filters

+----------------+--------------------------------------------------------------+
| Microsoft      |Alpha                           Barn                          |
| Filters        |BasicImage                      BlendTrans                    |
|                |Blinds                          Blur                          |
|                |CheckerBoard                    Chroma                        |
|                |Compositor                      DropShadow                    |
|                |Emboss                          Engrave                       |
|                |Fade                            FlipH                         |
|                |FlipV                           Glow                          |
|                |GradientWipe                    Gray                          |
|                |ICMFilter                       Inset                         |
|                |Invert                          Iris                          |
|                |Light                           MaskFilter                    |
|                |Matrix                          MotionBlur                    |
|                |Pixelate                        RadialWipe                    |
|                |RandomBars                      RandomDissolve                |
|                |RevealTrans                     Shadow                        |
|                |Slide                           Spiral                        |
|                |Stretch                         Strips                        |
|                |Wave                            Wheel                         |
|                |Xray                            Zigzag                        |
+----------------+--------------------------------------------------------------+



"runtimeStyle" Syntax and Note

Note:
Specify a style that will override any other style defined for the specified element.
    
Syntax:
    
document.all.elementID.runtimeStyle.memberName