Right now, the position of the datepicker is determined using the built-in css, which is added by javascript through the jQuery-UI framework. I would really like the date indicator to be in the center of the screen instead of being located depending on where my trigger is.
How to override this positioning created by jQuery with something mine? I even have a jQuery script to center the div in the center of the screen, but it still doesn't work due to the script being overwritten by jquery-ui's.
Inline code is generated here:
<div id="ui-datepicker-div" class="ui-datepicker
ui-widget ui-widget-content ui-helper- clearfix ui-corner-all
ui-datepicker-multi ui-datepicker-multi-2" style="width: 34em;
position: absolute; left: 349px; top: 453px; z-index: 1; display: block; ">
Here is the jQuery function to center the div on the screen:
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
return this;
}
which is called: $('.ui-datepicker').center();
What will be the code to use this function to center the div .ui-datepickerin the center of the screen?
EDIT: : http://univiaje.spin-demo.com/