|
Get Current Style Method Buy this website for $5000 USD Priced to sell, this is an established JavaScript website, growing in popularity as evidenced by its Alex ranking. Includes most website content. The price is NON-NEGOTIABLE. Serious buyers should contactMethod: CJL_getCurrentStyle() Summary: Cross-platform JavaScript method for retrieving style information set in either a CSS style sheet, a <style> block, or inline. Submitted: 04/01/2003 Created by: CodeHouse.com Browser Compatibility for this method
Demo The demo displays style information for styles set both inline and within a <style> block. Source Code The source code for this method is contained in the text area below. You can copy and paste it into your own source code. Before using the source code, make sure that you read and agree to the terms of the License Agreement, which will open in a separate window.
Method: CJL_getCurrentStyle(elem, prop) Description: Returns global style information for an element. The style could be set in either a CSS style sheet, a <style block, or inline. Example Usage: Assigns the width of the document's left margin to borderLeft. borderLeft = CJL_getCurrentStyle(document.body, "margin-left"); Comments: CJL_getCurrentStyle returns an undefined result when called using Opera 7 and Safari 1 beta. It is likely that these browsers will support this method in the future as this functionality is in the DOM specification. Parameters elem:
Target element to retrieve style information for.
This parameter is required.
prop:
CSS property of elem to retrieve style information for.
This parameter is required.
Return Value The value associated with the CSS property for the
target element. Note that not all CSS properties retrieved in this manner
are supported by both browsers. The type of result returned might vary
with the browser and version of the browser.
Support If you have any questions, find any bugs, or have suggestions, feel free to contact us. |