Saturday, November 23, 2013

Jquery ui datepicker appears off screen fix

/*e.g. $('.ui-datepicker').center();*/
  1. jQuery.fn.center = function () {  
  2.     this.css("position""absolute");  
  3.     this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");  
  4.     this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");  
  5.     return this;  
  6. }  

No comments: