[ 2 posts ]

hame25

  • Joined: Thu Apr 26, 2012 5:34 am
  • Posts: 35
  • Offline
  • Profile
Tags:

Overlay not centring properly

Post Posted: Fri Aug 03, 2012 1:39 am
+0-
Hi

I am having trouble when trying to centre an overlay initally upon a page.

The behaviour I am seeing is that on the initial show the top of the overlay is aligned to the centre of the viewport. However if the content in the overlay has a big height then it runs off screen.

If I then hide and show the overlay without a refresh then the overlay is correctly centred on the page.

code snippet I am using is:

//method to set overlay content
Code:
setContent();

overlay.render();
        //show overlay
        overlay.show();
        overlay.set("centered", true);
        overlay.set("constrain", true);


Is there something I am missing here?

Thanks in advance

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Overlay not centring properly

Post Posted: Fri Aug 03, 2012 5:42 am
+0-
Call `overlay.align()` at the end here and it will sync up the alignment correctly.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum