/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* ------------------------------------------------------------------ Fix Input Focus -------------------------------------------------- */ $.fn.inpFocus = function(settings) { // defaults settings settings = $.extend({ classFocus: "inpFocus" }, settings); return this.each( function() { $(this).find("input:text, input:password, textarea, select").each(function(){ $(this) .bind("focus.inpFocus", function(){ $(this).addClass(settings.classFocus); }) .bind("blur.inpFocus", function(){ $(this).removeClass(settings.classFocus); }) .blur();// now change all inputs }); }); };