最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

COMMENT 元素 | comment 對(duì)象 CUSTOM 元素 | custom 對(duì)象 DHTML 對(duì)象

currentStyle 對(duì)象


代表了在全局樣式表、內(nèi)嵌樣式和 HTML 標(biāo)簽屬性中指定的對(duì)象格式和樣式。

成員表

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

注釋

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

currentStyle 對(duì)象反映了樣式表中的樣式優(yōu)先順序。在 HTML 中此順序?yàn)椋?

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

從而,currentStyle 對(duì)象將為 bold 標(biāo)簽返回 fontWeightnormal,若在樣式表中為此標(biāo)簽指定了 normal。

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

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

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

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

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

示例

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

這個(gè)例子僅當(dāng)主體和文本顏色同時(shí)使用顏色名稱或 RGB 十六進(jìn)制值時(shí)可用,混合使用時(shí)無(wú)效。

<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 或以后版本。請(qǐng)單擊下面的圖標(biāo)安裝最新版本。然后重新裝入此頁(yè)再查看示例。

這個(gè)例子使用 currentStyle 對(duì)象獲取創(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 或以后版本。請(qǐng)單擊下面的圖標(biāo)安裝最新版本。然后重新裝入此頁(yè)再查看示例。

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

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

標(biāo)準(zhǔn)信息

沒有應(yīng)用于此對(duì)象的公共標(biāo)準(zhǔn)。

應(yīng)用到

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
额尔古纳市| 威远县| 盐津县| 长汀县| 淳安县| 普兰店市| 水富县| 高邑县| 巴中市| 沧源| 江孜县| 朝阳市| 浦东新区| 蕉岭县| 额济纳旗| 西平县| 徐水县| 房山区| 抚顺市| 铁岭县| 乌拉特后旗| 盐津县| 蒙自县| 凤山市| 双江| 阜城县| 铁力市| 抚松县| 北京市| 民乐县| 色达县| 广安市| 洪洞县| 礼泉县| 云龙县| 衡水市| 都江堰市| 长葛市| 岳阳县| 临湘市| 重庆市|