80 lines
2.6 KiB
XML
80 lines
2.6 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<xlib_symbol id='xSelect'>
|
|
|
|
<copyright>Copyright 2004-2005 Michael Foster (Cross-Browser.com)</copyright>
|
|
<license>Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL</license>
|
|
<groups>
|
|
<grp>Object</grp>
|
|
</groups>
|
|
<type>Object</type>
|
|
|
|
<description><![CDATA[Accessible Categories and Sub-Categories. xSelect is another experiment in unobtrusive DHTML. xSelect implements categories and sub-categories as two SELECT controls where the contents of the second control dynamically change depending on the selection in the main control.]]></description>
|
|
|
|
<syntax>new xSelect(sId, fnSubOnChange)</syntax>
|
|
|
|
<parameters>
|
|
<par>
|
|
<name>sId</name>
|
|
<note><![CDATA[the id of the 'downgrade' SELECT which contains OPTGROUPs]]></note>
|
|
</par>
|
|
<par>
|
|
<name>fnSubOnChange</name>
|
|
<note><![CDATA[the onchange event listener for the sub-category SELECT]]></note>
|
|
</par>
|
|
</parameters>
|
|
|
|
<properties>
|
|
<prop>
|
|
<name></name>
|
|
<note><![CDATA[]]></note>
|
|
</prop>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<dep>xGetElementById</dep>
|
|
<dep>xHide</dep>
|
|
<dep>xShow</dep>
|
|
<dep>xMoveTo</dep>
|
|
<dep>xOffsetLeft</dep>
|
|
<dep>xOffsetTop</dep>
|
|
</dependencies>
|
|
|
|
<demos>
|
|
<demo>
|
|
<url>http://cross-browser.com/x/examples/xselect.php</url>
|
|
<note><![CDATA[very accessible]]></note>
|
|
</demo>
|
|
</demos>
|
|
|
|
<comments>
|
|
<comment>
|
|
<date></date>
|
|
<author>mf</author>
|
|
<note><![CDATA[
|
|
In your html create a SELECT element (s0) which contains OPTGROUP elements.
|
|
Within each OPTGROUP are any number of OPTION elements.
|
|
Given the id of s0, xSelect creates two SELECT elements:
|
|
The 'main category' SELECT (s1) contains an OPTION for each OPTGROUP in s0.
|
|
The 'sub-category' SELECT (s2) is dynamically filled with OPTGROUP OPTIONs
|
|
depending on which category is selected in s1.
|
|
s1 and s2 are dynamically created and appended to the same form which contains s0.
|
|
s0 is hidden, s1 is positioned where s0 was, and s2 is positioned to the right of s1.
|
|
If the browser doesn't support the objects required by xSelect, or if the user has
|
|
javascript disabled, then the user will get the original SELECT which contains all
|
|
main categories (as OPTGROUPs) and all sub-categories (as OPTIONs within each OPTGROUP).
|
|
]]></note>
|
|
</comment>
|
|
</comments>
|
|
|
|
<revisions>
|
|
<rev>
|
|
<num>1</num>
|
|
<date>9May05</date>
|
|
<author>mf</author>
|
|
<note><![CDATA[Put in it's own file for use with XC. Still working on opera8 offset bug.]]></note>
|
|
</rev>
|
|
</revisions>
|
|
|
|
</xlib_symbol>
|