Posted By

touffies on 11/12/10


Tagged

ie input jquery focus


Versions (?)

Fix Input Focus


 / Published in: jQuery
 

  1. /* ------------------------------------------------------------------
  2.   Fix Input Focus -------------------------------------------------- */
  3. $.fn.inpFocus = function(settings) {
  4. // defaults settings
  5. settings = $.extend({
  6. classFocus: "inpFocus"
  7. }, settings);
  8. return this.each( function() {
  9. $(this).find("input:text, input:password, textarea, select").each(function(){
  10. $(this)
  11. .bind("focus.inpFocus", function(){
  12. $(this).addClass(settings.classFocus);
  13. })
  14. .bind("blur.inpFocus", function(){
  15. $(this).removeClass(settings.classFocus);
  16. })
  17. .blur();// now change all inputs
  18. });
  19. });
  20. };

Report this snippet  

You need to login to post a comment.