jQuery.combobox, 给文本框添加下拉选项的轻量级插件

这是一个轻量级的 jQuery 插件,可以将普通的文本框转换为组合框,允许用户输入文本或从提供的选项中选择。该插件现已支持大小写不敏感的匹配,并可以在同一文本框上多次设置。在 IE7 和 Firefox3 中进行了测试。

o_jquery.combobox.gif

Description

jQuery.combobox is a lightweight jQuery plugin which transforms a textbox into a combobox, so users can enter text or select from supplied options.

It could be called more than once on the same textbox, however only the first time calling counts -- which means you can't change the suggestions once the combobox is created.

It would work with jQuery.bgiframe plugin to fix the IE select/zIndex bug if you include it in the same page.

Tested in IE 7, Firefox 3.

Updates

2009-3-18
Suggestion matching is now case-insensitive
The second time setting up combobox on the same textbox is working now
Fixed the IE relative z-index bug by avoiding relative positioning

Demostartion

Combobox 1

Combobox 2

12 This is a select box to see if there is a problem in IE.

Usage

Html

<input class="combo" />

Script

<link href="jquery.combobox.css" rel="stylesheet" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.combobox.min.js"></script>

jQuery('.combo').combobox(['option1', 'option2', 'option3', ...], {imageUrl : '/images/dropdown.gif'});

 

Copyright

It's released under the MIT licence, so use it however you want.

By deerchao@gmail.com on 2009-3-16

Download

http://files.cnblogs.com/deerchao/jquery.combobox.zip

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值