GithubHelp home page GithubHelp logo

webin / fauxselect.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from easy-designs/fauxselect.js

0.0 2.0 0.0 120 KB

A script to allow you to create customized SELECT elements

License: MIT License

fauxselect.js's Introduction

== FauxSelect

This script builds a stylable, accessible SELECT replacement.

== Current Version

0.2 (4 August 2007)

== Requirements

  * Prototype
  * mod.Moo.fx (bundled)

== License

FauxSelect is distributed under the liberal MIT License.

== Use

To 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.

== Customization

To 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):

  * .faux-container - contains the whole widget
  * p.faux-value - the displayed value
  * .faux-container p.focused - the displayed value when the faux-SELECT has focus
  * ul.faux-select - the list of faux-OPTIONS
  * ul.faux-select li - the faux-OPTIONs
  * ul.faux-select .hover - a faux-OPTION in it's hover state
  * ul.faux-select .selected - a faux-OPTION in it's selected state

== How it works

For detailed instructions on how this script works, check out the case study in AdvancED DOM Scripting (2007, Friends of ED)

== Demo

A demo is included in the ./demo directory.

== Change Log

  * 0.1 (12 September 2006) - Initial script
  * 0.2 (4 August 2007) - Added automatic directory calculation for `FauxSelect.css` inclusion.

fauxselect.js's People

Contributors

aarongustafson avatar

Watchers

James Cloos avatar jibin.hou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.