一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

jquery修改css样式函数

时间:2010-11-02 编辑:简简单单 来源:一聚教程网

下面提供一款jquery修改css样式函数,他可以修改text password submit reset button radio textarea checkbox file以及focus  blur 事件等。
*/

$(document).ready(function(){
 $("input[type='text']").addclass('input_blur');
 $("input[type='password']").addclass('input_blur');
    $("input[type='submit']").addclass('button_style');
    $("input[type='reset']").addclass('button_style');
    $("input[type='button']").addclass('button_style');
    $("input[type='radio']").addclass('radio_style');
    $("input[type='checkbox']").addclass('checkbox_style');
    $("input[type='textarea']").addclass('textarea_style');
    $("input[type='file']").addclass('file_style');
 $("input[type='file']").blur(function () { this.classname='input_blur'; } );
 $("input[type='file']").focus(function () { this.classname='input_focus'; } );
 $("input[type='password']").blur(function () { this.classname='input_blur'; } );
 $("input[type='password']").focus(function () { this.classname='input_focus'; } );
 $("input[type='text']").blur(function () { this.classname='input_blur'; } );
 $("input[type='text']").focus(function () { this.classname='input_focus'; } );
    $("textarea").blur(function () { this.classname='textarea_style'; } );
 $("textarea").focus(function () { this.classname='textarea_focus'; } )
 $(".table_list tr").mouseo教程ver(function () { this.classname='mouseover'; } );
 $(".table_list tr").mouseout(function () { this.classname=''; } );
 $(".inputtitle").focus(function () { this.classname='inputtitle'; } );
 $(".inputtitle").blur(function () { this.classname='inputtitle'; } );   
});

热门栏目