JIM Control Usage Manual : Reading And Using Stylesheet Data, Even If It Is External [ To Table Of Contents ]
With some of the more advanced scripting that may occur, it has been a frequent problem of not being able to retrieve class attributes when elements are created dynamically and reference styles...among other issues. A new feature of the JIM Control is to allow you to get the value of an attribute inside of a CSS class DIRECTLY whether the stylesheet is inline to the web page (such as <style type="text/css">) or is an externally linked CSS stylesheet. In order to get the value of an attribute in a class, all you have to do is specify the class name and the attribute you want to get the value for and the JIM Control takes care of the rest for you. Let's look at an example:
You Have This CSS Class:
.mousemenu {
width: 50;
height: 75;
}
Let's say that you want to retrieve the width attribute value of .mousemenu. Simply use the JIM Control function, as specified below, to get the value:
wfind_css_class('.mousemenu', 'width');
wfind_css_class(element_label, element_chunk)
-> Use this function to retrieve the value of an attribute in a CSS class whether the class is inline or contained inside of an externally linked stylesheet.
Hyper-Link Example (you could also call the function in your own javascript):
<a href="#" onmousedown="javascript:biff.innerHTML=wfind_css_class('.mousemenu','width');" class="tablinkahref">Retrieve Width of .mousemenu</a>
What The Fields Mean:
element_label
Name of the CSS class to return the attribute value of.
element_chunk
The attribute name containing the value you want returned.
Function Return Value
Returns the value of the attribute specified for the CSS class queried.