欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

COMMENT 元素 | comment 對象 CUSTOM 元素 | custom 對象 DHTML 對象

currentStyle 對象


代表了在全局樣式表、內嵌樣式和 HTML 標簽屬性中指定的對象格式和樣式。

成員表

屬性描述
blockDirection 獲取表明塊元素內容的繞排方向的值,是由左至右,還是由右至左。
clipBottom 獲取對象剪裁區(qū)域的底邊坐標。
clipLeft 獲取對象剪裁區(qū)域的左邊坐標。
clipRight 獲取對象剪裁區(qū)域的右邊坐標。
clipTop 獲取對象剪裁區(qū)域的頂邊坐標。
onOffBehavior 獲取表明指定的 Microsoft® DirectAnimation® 行為是否正在運行的對象。
方法描述
getAttribute 獲取指定標簽屬性的值。
getExpression 獲取給定屬性的表達式。
setAttribute 設置指定標簽屬性的值。
setExpression 設置指定對象的表達式。
樣式標簽屬性樣式屬性描述
ACCELERATOR accelerator 獲取表明對象是否包含快捷鍵的字符串。
background-attachment backgroundAttachment 設置或獲取背景圖像如何附加到文檔內的對象中。
background-color backgroundColor 設置或獲取對象內容后的顏色。
background-image backgroundImage 設置或獲取對象的背景圖像。
background-position-x backgroundPositionX 設置或獲取 backgroundPosition 屬性的 x 坐標。
background-position-y backgroundPositionY 設置或獲取 backgroundPosition 屬性的 y 坐標。
background-repeat backgroundRepeat 設置或獲取對象backgroundImage 屬性如何平鋪。
behavior behavior 設置或獲取 DHTML 行為的位置。
border-bottom-color borderBottomColor 設置或獲取對象下邊框的顏色。
border-bottom-style borderBottomStyle 設置或獲取對象下邊框的樣式。
border-bottom-width borderBottomWidth 設置或獲取對象下邊框的寬度。
border-collapse borderCollapse 設置或獲取表明表格行和單元格邊框是組合為單一邊框還是像標準 HTML 那樣分離。
border-color borderColor 設置或獲取對象的邊框顏色。
border-left-color borderLeftColor 設置或獲取對象左邊框的顏色。
border-left-style borderLeftStyle 設置或獲取對象左邊框的樣式。
border-left-width borderLeftWidth 設置或獲取對象左邊框的寬度。
border-right-color borderRightColor 設置或獲取對象右邊框的顏色。
border-right-style borderRightStyle 設置或獲取對象右邊框的樣式。
border-right-width borderRightWidth 設置或獲取對象右邊框的寬度。
border-style borderStyle 設置或獲取對象上下左右邊框的樣式。
border-top-color borderTopColor 設置或獲取對象上邊框的顏色。
border-top-style borderTopStyle 設置或獲取對象上邊框的樣式。
border-top-width borderTopWidth 設置或獲取對象上邊框的寬度。
border-width borderWidth 設置或獲取對象上下左右邊框的寬度。
bottom bottom 設置或獲取對象相對于文檔層次中下個定位對象的底部的位置。
clear clear 設置或獲取對象是否允許在其左側、右側或兩邊放置浮動對象,以防下段文本顯示在浮動對象上。
color color 設置或獲取對象文本的顏色。
cursor cursor 設置或獲取當鼠標指針指向對象時所使用的鼠標指針。
direction direction 設置或獲取對象的閱讀順序。
display display 設置或獲取對象是否要渲染。
font-family fontFamily 設置或獲取對象文本所使用的字體名稱。
font-size fontSize 設置或獲取對象文本使用的字體大小。
font-style fontStyle 設置或獲取對象的字體樣式,如斜體、常規(guī)傾斜。
font-variant fontVariant 設置或獲取對象文本是否以小型大寫字母顯示。
font-weight fontWeight 設置或獲取對象的字體寬度。
hasLayout 獲取表明對象是否有布局的值。
height height 設置或獲取對象的高度。
ime-mode imeMode 獲取輸入方法編輯器(IME)的狀態(tài)。
layout-flow layoutFlow 設置或獲取對象內容的方向和繞排方向。
layout-grid-char layoutGridChar 設置或獲取用于渲染元素文本內容的字符網格大小。
layout-grid-line layoutGridLine 設置或獲取用于渲染元素文本內容的網格線值。
layout-grid-mode layoutGridMode 設置或獲取文本布局網格是否使用二維。
layout-grid-type layoutGridType 設置或獲取用于渲染元素文本內容的網格類型。
left left 設置或獲取對象相對于文檔層次中下個定位對象的左邊界的位置。
letter-spacing letterSpacing 設置或獲取對象的字符間附加空間的總和。
line-break lineBreak 設置或獲取日本文本的換行規(guī)則。
line-height lineHeight 設置或獲取對象兩行間的距離。
list-style-image listStyleImage 獲取要為對象應用的列表項目符號的圖像。
list-style-position listStylePosition 獲取相對于對象內容如何繪制項目符號。
list-style-type listStyleType 獲取對象預定義的項目符號類型。
margin margin 設置或獲取對象的上下左右邊距。
margin-bottom marginBottom 設置或獲取對象的下邊距寬度。
margin-left marginLeft 設置或獲取對象的左邊距寬度。
margin-right marginRight 設置或獲取對象的右邊距寬度。
margin-top marginTop 設置或獲取對象的上邊距寬度。
min-heightMicrosoft® Internet Explorer 6 新增 minHeight 設置或獲取元素的最小高度。
overflow overflow 設置或獲取表明當內容超出對象高度或寬度時如何管理對象內容的值。
overflow-x overflowX 設置或獲取當內容超出對象寬度時如何管理對象內容。
overflow-y overflowY 設置或獲取當內容超出對象高度時如何管理對象內容。
padding padding 設置或獲取要在對象和其邊距或若存在的邊框的話就是對象和其邊框之間要插入的全部空間。
padding-bottom paddingBottom 設置或獲取要在對象下邊框和內容之間插入的空間總量。
padding-left paddingLeft 設置或獲取要在對象左邊框和內容之間插入的空間總量。
padding-right paddingRight 設置或獲取要在對象右邊框和內容之間插入的空間總量。
padding-top paddingTop 設置或獲取對象上邊框和內容之間插入的空間總量。
page-break-after pageBreakAfter 設置或獲取表明對象后發(fā)生換頁的字符串。
page-break-before pageBreakBefore 設置或獲取表明對象前發(fā)生換頁的字符串。
position position 設置或獲取對象所使用的定位方式。
right right 設置或獲取對象相對于文檔層次中下個已定位的對象的右邊界的位置。
ruby-align rubyAlign 獲取由 RT 對象指定的注音文本的位置。
ruby-overhang rubyOverhang 獲取由 RT 對象指定的注音文本的位置。
ruby-position rubyPosition 獲取由 RT 對象指定的注音文本的位置。
scrollbar-3dlight-color scrollbar3dLightColor 設置或獲取滾動條上滾動按鈕和滾動滑塊的左上顏色。
scrollbar-arrow-color scrollbarArrowColor 設置或獲取滾動箭頭標識的顏色。
scrollbar-base-color scrollbarBaseColor 設置或獲取滾動條的主要顏色,其中包含滾動按鈕和滾動滑塊。
scrollbar-darkshadow-color scrollbarDarkShadowColor 設置或獲取滾動條上滑槽的顏色。
scrollbar-face-color scrollbarFaceColor 設置或獲取滾動條和滾動條的滾動箭頭的顏色。
scrollbar-highlight-color scrollbarHighlightColor 設置或獲取滾動框和滾動條滾動箭頭的左上邊緣顏色。
scrollbar-shadow-color scrollbarShadowColor 設置或獲取滾動框和滾動條滾動箭頭的右下邊緣顏色。
scrollbar-track-color scrollbarTrackColor 設置或獲取滾動條軌跡元素的顏色。
float styleFloat 設置或獲取文本要繞排到對象的哪一側。
table-layout tableLayout 獲取表明表格布局是否固定的字符串。
text-align textAlign 設置或獲取對象中的文本是左對齊、右對齊、居中對齊還是兩端對齊。
text-align-last textAlignLast 設置或獲取如何排列對象的最后一行或僅有的一行。
text-autospace textAutospace 設置或獲取自動留空和文本的窄空間寬度調整。
text-decoration textDecoration 設置或獲取對象中的文本是否有閃爍、刪除線、上劃線或下劃線的樣式。
text-indent textIndent 設置或獲取對象中文本的縮進。
text-justify textJustify 設置或獲取對象內的文本所使用的對齊類型。
text-kashida-space textKashidaSpace 設置或獲取對象內文本對齊行時所使用空白擴展的 kashida 擴展的倍率。
text-overflowMicrosoft® Internet Explorer 6 新增 textOverflow 設置或獲取表明是否顯示省略號以表明文本溢出的值。
text-transform textTransform 設置或獲取對象中文本的渲染方式。
text-underline-position textUnderlinePosition 設置或獲取對象textDecoration 屬性中設置的下劃線的位置。
top top 設置或獲取對象相對于文檔層次中下個定位對象的上邊界的位置。
unicode-bidi unicodeBidi 設置或獲取關于雙向法則的嵌入級別。
vertical-align verticalAlign 設置或獲取對象的垂直排列。
visibility visibility 設置或獲取對象的內容是否顯示。
white-space whiteSpace 設置或獲取對象中是否自動換行。
width width 設置或獲取對象的寬度。
word-break wordBreak 設置或獲取單詞內的換行行為,特別是對象中出現多語言的情況。
word-spacing wordSpacing 設置或獲取對象中單詞間的附加空間總量。
word-wrap wordWrap 設置或獲取當內容超過其容器邊界時是否斷詞。
writing-mode writingMode 設置或獲取對象內容的方向和繞排。
z-index zIndex 設置或獲取定位對象的堆疊次序。
zoom zoom 設置或獲取對象的放大比例。

注釋

currentStyle 對象返回了元素上的樣式表,但是 style 對象只返回通過 STYLE 標簽屬性應用到元素的內嵌樣式。因此,通過 currentStyle 對象獲取的樣式值可能與通過 style 對象獲取的樣式值不同。例如,如果段落的 color 屬性值通過鏈接或嵌入樣式表設置為紅色( red ),而不是內嵌的話,對象.currentStyle.color 將返回正確的顏色,而對象 style.color 不能返回值。但是,如果用戶指定了 <P STYLE="color:'red'">,currentStyleSTYLE 對象都將返回值 red。

currentStyle 對象反映了樣式表中的樣式優(yōu)先順序。在 HTML 中此順序為:

  1. 內嵌樣式
  2. 樣式表規(guī)則
  3. HTML 標簽屬性
  4. HTML 標簽的內部定義

從而,currentStyle 對象將為 bold 標簽返回 fontWeightnormal,若在樣式表中為此標簽指定了 normal。

currentStyle 返回反映頁面所應用的樣式設置的值,但可能并不反映獲取值時渲染所采用的值。例如,樣式值設置為 "color:red; display:none" 的對象,將返回 currentStyle.color 為 red,盡管該對象并不在頁面上渲染。也就是說,currentStyle 對象并不受渲染與否的綁定。在下面示例區(qū)的第三個例子演示了此行為。禁用的樣式表也不影響 currentStyle 值。

返回值的單位與設置對象時的單位相同。例如,若對象的顏色是以內嵌 STYLE="color:'green'" 的格式設置的,那么 object.currentStyle.color 將返回 green 而不是 #00FF00 (與綠色相等的紅綠藍十六進制值)。但是,當 currentStyle 對象返回對象值的時候出現在作者所設置的對象值中的大寫和多余的空白將被去掉。

currentStyle 對象支持用戶自定義的樣式規(guī)則屬性。請參看示例區(qū)的第二個例子。

currentStyle 對象是異步的。這意味著樣式不可能被設置后馬上就能查詢,而是返回舊值。因此,對于含有 addImport 這樣方法的想要獲得所期待的 currentStyle 行為的腳本,該腳本需要包含一個調用方法的函數和一個檢查 currentStyle 的函數。對于需要在頁面裝載的時候檢查當前屬性的腳本,腳本必須等到 body 元素裝入且頁面被選然后,否則 currentStyle 的值可能不反映所顯示的情況。

此對象在 Microsoft® Internet Explorer 5 的腳本中可用。

示例

下面的例子使用 currentStyle 對象將文本顏色設置為棕色。如果你單擊著色區(qū)域并且背景顏色與文本顏色相同,checkColor 函數就會更改背景顏色,以方便閱讀文本。否則,該函數不做任何操作。

這個例子僅當主體和文本顏色同時使用顏色名稱或 RGB 十六進制值時可用,混合使用時無效。

<SCRIPT>
function checkColor(oObj)
{
if (oObj.currentStyle.backgroundColor == 'brown')
{
oObj.style.backgroundColor = 'white';
}
else
:
}
</SCRIPT>
</HEAD>
:
<P STYLE="background-color: 'brown'"
onclick="checkColor(this)">
此特性需要 Microsoft® Internet Explorer 5.0 或以后版本。請單擊下面的圖標安裝最新版本。然后重新裝入此頁再查看示例。

這個例子使用 currentStyle 對象獲取創(chuàng)建于樣式規(guī)則的用戶自定義屬性。alert 返回值 myvalue。

<STYLE>
P { myproperty:myvalue }
</STYLE>
<BODY>
<P ID=oPrgrph>
:
<SCRIPT>
alert(oPrgrph.currentStyle.myproperty)
</SCRIPT>
此特性需要 Microsoft® Internet Explorer 5.0 或以后版本。請單擊下面的圖標安裝最新版本。然后重新裝入此頁再查看示例。

這個例子由 currentStyle 對象返回的 td 對象寬度是其層疊寬度值而不是屏幕上渲染的寬度值。

<BODY ID=oBdy>
:
<TABLE BORDER>
<TR><TD WIDTH=1100 ID=oTblD>text</TD></TR>
</TABLE>
:
<SCRIPT>
alert("TD 對象 currentStyle.width 為 " +
oTblD.currentStyle.width + ".\n" +
"窗口的寬度為 " + oBdy.clientWidth +
"px.\n屏幕的寬度為 " + screen.width + "px." )
</SCRIPT>
此特性需要 Microsoft® Internet Explorer 5.0 或以后版本。請單擊下面的圖標安裝最新版本。然后重新裝入此頁再查看示例。

標準信息

沒有應用于此對象的公共標準。

應用到

a, acronym, address, applet, b, bdo, big, blockQuote, body, br, button, caption, center, cite, code, col, colGroup, custom, dd, del, dfn, dir, div, dl, dt, em, embed, fieldSet, font, form, hn, html, i, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, ins, isIndex, kbd, label, legend, li, listing, marquee, menu, noBr, object, ol, option, p, plainText, pre, q, s, samp, select, small, span, strike, strong, sub, sup, table, tBody, td, textArea, tFoot, th, tHead, tr, tt, u, ul, var, wbr, xmp

參看

style