|
FauxSelect
This script builds a stylable, accessible SELECT replacement
Current Version0.2 (4 August 2007) Requirements
LicenseFauxSelect is distributed under the liberal MIT License. UseTo use, simply include FauxSelect.js and mod-moo.fx.js in the HEAD of your document and store FauxSelect.css in the same folder as FauxSelect.js. Then, initialize the FauxSelectConductor: // if Prototype, selects & required DOM methods are available
if( typeof( FauxSelectConductor ) != 'undefined' &&
typeof( Prototype ) != 'undefined' &&
typeof( Fx ) != 'undefined' &&
document.getElementById &&
document.getElementsByTagName &&
document.createElement &&
document.getElementsByTagName( 'select' ) ){
window.observe( 'load', function(){
FauxSelectConductor.initialize( { maxHeight: 300 } );
} );
}You can supply a maximum height when initializing the FauxSelectConductor. CustomizationTo customize the look of your FauxSelect, you can hook into the following selectors in your main stylesheet (default styles have been provided and are easily overridden with greater specificity):
How it worksFor detailed instructions on how this script works, check out the case study in AdvancED DOM Scripting (2007, Friends of ED) DemoView the demo. Optimized ReleasesDevelopment VersionIf you are interested in helping to further develop this script, you can download the uncompressed JavaScript source file. Change Log
|
Sign in to add a comment