扩展JQUERY功能
2010-02-19 20:36
253 查看
$.fn.disable = function(){
//扩展jQuery,表单元素统一disable
return this.each(function(){
if(typeof this.disabled != "undefined") this.disabled = true;
});
}
$.fn.enable = function(){
//扩展jQuery,表单元素统一enable
return this.each(function(){
if(typeof this.disabled != "undefined") this.disabled = false;
});
}
function SwapInput(oName,oButton){
if(oButton.value == "Disable"){
//如果按钮的值为Disable,则调用disable()方法
$("input[name="+oName+"]").disable();
oButton.value = "Enable";
}else{
//如果按钮的值为Eable,则调用enable()方法
$("input[name="+oName+"]").enable();
oButton.value = "Disable"; //然后设置按钮的值为Disable
}
}
//扩展jQuery,表单元素统一disable
return this.each(function(){
if(typeof this.disabled != "undefined") this.disabled = true;
});
}
$.fn.enable = function(){
//扩展jQuery,表单元素统一enable
return this.each(function(){
if(typeof this.disabled != "undefined") this.disabled = false;
});
}
function SwapInput(oName,oButton){
if(oButton.value == "Disable"){
//如果按钮的值为Disable,则调用disable()方法
$("input[name="+oName+"]").disable();
oButton.value = "Enable";
}else{
//如果按钮的值为Eable,则调用enable()方法
$("input[name="+oName+"]").enable();
oButton.value = "Disable"; //然后设置按钮的值为Disable
}
}
相关文章推荐
- jQuery 学习第七课 扩展jQuery的功能 插件开发
- 采用Jquery,在table上实现对行的单击、双击、返回选中行数据的功能,可作为GridView控制客户端的扩展
- jQuery 学习第七课 扩展jQuery的功能 插件开发
- jQuery插件formValidator自定义函数扩展功能实例详解
- 给select2 jQuery下拉条select美化及功能扩展插件增加拼音筛选功能
- (十三)jQuery的Ajax功能扩展代码
- 扩展jQuery的功能限制只能输入数字
- 插件基础篇2:扩展jQuery的功能 插件开发
- 采用Jquery,在table上实现对行的单击、双击、返回选中行数据的功能,可作为GridView控制客户端的扩展
- jQuery扩展+xml实现表单验证功能的方法
- jQuery来源学习笔记:扩展的实用功能
- 用原生javascript实现jQuery效果——自定义javascript扩展DOM函数及功能
- jQuery基于扩展简单实现倒计时功能的方法
- 基于jquery做插件扩展功能
- jQuery插件FullCalendar日程表实现可扩展Google日历功能
- JQuery.autocomplete扩展功能:实现多列自动提示
- 扩展jquery实现客户端表格的分页、排序功能代码
- jquery-easyui中datagrid扩展,隐藏显示表头功能
- [JQuery]分页插件jQuery pager plugin功能扩展
- 扩展jQuery的json功能