How to use
Refer to example.htm for how to use it.
For your convenience, a minified file is provided. Use the minified version, unless you're debugging.
Include the CSS file in your HTML:
<link rel="stylesheet" href="assets/main.css" type="text/css" />
You can safely append the contents of these JS and CSS files to your own to save on an extra request in your main page.
Include a div with an ID and the class set to "tristate":
<div id="tri_id" class="tristate"/>
Submitted tristates will have their field name set to the ID specified in the div. The value will be either "yes", "no" or "none".
You can easily change the images for each state, and the data submitted to the server, by editing main.js. Just change the values of YES, NO and NONE
- Chrome 15
- Firefox 6
- IE 8
- Safari 5.1
If you try it on a platform that is not listed here, please let me know the result.
- 0.1 - 07-sep-2011 - Initial Release
Copyright (c) 2011, Supernifty. All rights reserved. http://www.supernifty.com.au/
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Actually, there aren't any conditions, except for the disclaimer below:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.