jQuery plugin 改造:Select Box replacement
Saturday, 26. April 2008, 08:51:26
由于改动比较多,就不一一细说了。
修改后的代码可以从这儿下载。
无不用其“极”
Saturday, 26. April 2008, 08:51:26
Friday, 7. December 2007, 10:07:34
(function($){
/**
* Get selected option's property
*/
$.fn.getSelectedProperty = function(property) {
var arrValue = Array();
var a=0;
this.each( function() {
for (var i=0; i < this.options.length; i++) {
if (this.options[i].selected == true) {
arrValue[a] = this.options[i][property];
a++;
}
}
});
if(arrValue.length > 1) {
return arrValue;
} else if(arrValue.length == 1) {
return arrValue[0];
}
return '';
};
})(jQuery);alert($("#select_box_id").getSelectedProperty('text')); | S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
LinuxSir
Linux中坚站
为Linux工程师提供技术动力
打造中国最大的UNIX/LINIX资讯站
My mirror, my window, the bridge connecting you and I.
关注:php,mysql,ajax ,linux, js,开源
有用的Opera菜单
なにもあたらしくない
By Adam Li
By Satoru Watanabe
by singway
by 摸鱼儿
by Somh
by 法师
by yumumao
Maybe I was a Bird in another Life !
投放广告挣美元,可用PayPal接收付款
免费网页模板
数据表格样式收集