打印版式

Class Ext.util.CSS

Package:Ext.util
Class:CSS
Extends:Object
Defined In:CSS.js
Utility class for manipulating CSS rules

This class is a singleton and cannot be created directly.

属性   -  方法   -  事件

公共属性

此类没有公共属性。

公共方法

方法 定义对象
  createStyleSheet(String cssText) : StyleSheet CSS
Very simple dynamic creation of stylesheets from a text blob of rules. The text will wrapped in a style tag and appe...
  getRule(String/Array selector, Boolean refreshCache) : CSSRule CSS
Gets an an individual CSS rule by selector(s)
  getRules(Boolean refreshCache) : Object CSS
Gets all css rules for the document
  refreshCache() : Object CSS
Refresh the rule cache if you have dynamically added stylesheets
  removeStyleSheet(String id) : void CSS
Removes a style or link tag by id
  swapStyleSheet(String id, String url) : void CSS
Dynamically swaps an existing stylesheet reference for a new one
  updateRule(String/Array selector, String property, String value) : Boolean CSS
Updates a rule property

公共事件

此类没有公共事件。

方法详情

createStyleSheet

public function createStyleSheet(String cssText)
Very simple dynamic creation of stylesheets from a text blob of rules. The text will wrapped in a style tag and appended to the HEAD of the document.
参数:
  • cssText : String
    The text containing the css rules
返回:
  • StyleSheet
This method is defined by CSS.

getRule

public function getRule(String/Array selector, Boolean refreshCache)
Gets an an individual CSS rule by selector(s)
参数:
  • selector : String/Array
    The CSS selector or an array of selectors to try. The first selector that is found is returned.
  • refreshCache : Boolean
    true to refresh the internal cache if you have recently updated any rules or added styles dynamically
返回:
  • CSSRule
    The CSS rule or null if one is not found
This method is defined by CSS.

getRules

public function getRules(Boolean refreshCache)
Gets all css rules for the document
参数:
  • refreshCache : Boolean
    true to refresh the internal cache
返回:
  • Object
    An object (hash) of rules indexed by selector
This method is defined by CSS.

refreshCache

public function refreshCache()
Refresh the rule cache if you have dynamically added stylesheets
参数:
  • 无。
返回:
  • Object
    An object (hash) of rules indexed by selector
This method is defined by CSS.

removeStyleSheet

public function removeStyleSheet(String id)
Removes a style or link tag by id
参数:
  • id : String
    The id of the tag
返回:
  • void
This method is defined by CSS.

swapStyleSheet

public function swapStyleSheet(String id, String url)
Dynamically swaps an existing stylesheet reference for a new one
参数:
  • id : String
    The id of an existing link tag to remove
  • url : String
    The href of the new stylesheet to include
返回:
  • void
This method is defined by CSS.

updateRule

public function updateRule(String/Array selector, String property, String value)
Updates a rule property
参数:
  • selector : String/Array
    If it's an array it tries each selector until it finds one. Stops immediately once one is found.
  • property : String
    The css property
  • value : String
    The new value for the property
返回:
  • Boolean
    true If a rule was found and updated
This method is defined by CSS.

Ext - Copyright © 2006-2007 Ext JS, LLC
All rights reserved.