I am currently working on centering a div and would like to utilize this jQuery function...
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;
}
After successfully centering the first div, I am looking to position another div directly above it in order to achieve the following layout...
|-------------|
| Moved Above |
|-------------|
| |
| Centered |
| |
|-------------|
Could someone guide me on how to accomplish this task?