PDA

View Full Version : Fixedcenter on long pages



gizzmo
3 Jan 2007, 1:38 PM
Hi

I have problem using fixedcenter and basic dialog.
If the page is too long, so you have to scroll, and you open the dialog from the bottom of the page, it doesn't get centered.

I have read a couple of threads with the same question, but can't get it to work with the suggestion in them. I have tried:


fixedcenter:true,
constraintoviewport: false

Any more suggestion. I use latest release.

Johan

thepisu
1 Jun 2007, 4:51 AM
Same problem here... one solution can be moving the dialog after opening it... something like this:



dialog.show();
var dialogWidth = 500;
var dialogHeight = 400;
var scrollTop = (YAHOO.ext.util.Browser.isIE)?document.documentElement.scrollTop :window.pageYOffset;
var x = Math.round((YAHOO.util.Dom.getViewportWidth()-dialogWidth)/2);
var y = Math.round((YAHOO.util.Dom.getViewportHeight()-dialogHeight)/2) + scrollTop;
dialog.moveTo(x,y);


But this is a workaround, not so nice... I tried increasing the "x" value on the dialog creation config (x: scrollTop), but the dialog renders always at the top of the page.