selectMe 下拉框里面复选框和单选框效果
XML/HTML Code
- <form action="#" method="get">
- <h3>复选</h3>
- <p>
- <select id="first" name="first" multiple>
- <option value="1">Iron Maiden</option>
- <option value="2">Metallica</option>
- <option value="3">Slayer</option>
- <option value="4">Judas Priest</option>
- <option value="5">Megadeath</option>
- <option value="6">Black Sabbath</option>
- <option value="7">Pantera</option>
- <option value="8">Death</option>
- <option value="9">Motörhead</option>
- <option value="10">Anthrax</option>
- <option value="11">Guns N' Roses</option>
- <option value="12">Deep Purple</option>
- <option value="13">Slipknot</option>
- <option value="14">Lamb of God</option>
- <option value="15">Type O Negative</option>
- <option value="16">AC/DC</option>
- <option value="17">Papa Roach</option>
- <option value="18">System of a Down</option>
- <option value="19">Mastodon</option>
- <option value="20">Opeth</option>
- </select>
- </p>
- <h3>单选</h3>
- <p>
- <select id="second" name="second">
- <option value="1">Iron Maiden</option>
- <option value="2">Metallica</option>
- <option value="3">Slayer</option>
- <option value="4">Judas Priest</option>
- <option value="5">Megadeath</option>
- <option value="6">Black Sabbath</option>
- <option value="7">Pantera</option>
- <option value="8">Death</option>
- <option value="9">Motörhead</option>
- <option value="10">Anthrax</option>
- <option value="11">Guns N' Roses</option>
- <option value="12">Deep Purple</option>
- <option value="13">Slipknot</option>
- <option value="14">Lamb of God</option>
- <option value="15">Type O Negative</option>
- <option value="16">AC/DC</option>
- <option value="17">Papa Roach</option>
- <option value="18">System of a Down</option>
- <option value="19">Mastodon</option>
- <option value="20">Opeth</option>
- </select></p>
- <input type="submit" value="Submit" />
- </form>
JavaScript Code
- <script>
- $.noConflict();
- jQuery('#first').selectMe(
- {
- width: '300px',
- columnCount: 2,
- search: true,
- }
- );
- jQuery('#second').selectMe(
- {
- width: '300px',
- columnCount: 2,
- search: true,
- }
- );
- </script>
原文地址:http://www.freejs.net/article_jquerywenzi_694.html