Greybox onload & centered

Hi,

I have greybox loading automatically when a user goes onto a webpage using

AJS.AEV(window, 'load', function() {
          GB_show("Hello world", "http://google.com");
     });

(from http://orangoo.com/labs/GreyBox/FAQ/#q4)

this works perfectly with the only downside being that it appears at the top of the page. There is also a method to center the greybox on the page but only on click. I need a way to combine the two so that the greybox centers on page automatically.

Any ideas anyone?

I hope I have explained this properly.

Many thanks in advance.

Cheers Simple User,

solution so, pardon the pun, simple.

Thanks again.

Hi maximusimo this might help I know it a bit late and you may have found the answer to this I have trying to solve this myself and found this answer …

Before

AJS.AEV(window, 'load', function() {
          GB_show("Hello world", "http://google.com");
     });

After

AJS.AEV(window, 'load', function() {
          GB_showCenter("Hello world", "http://google.com", callback_fn);
     });

Or With Width and Height

AJS.AEV(window, 'load', function() {
          GB_showCenter("Hello world", "http://google.com", /* optional */ height, width, callback_fn);
     });

For Fullscreen

AJS.AEV(window, 'load', function() {
          GB_showFullScreen("Hello world", "http://google.com", callback_fn);
     });

For Page

AJS.AEV(window, 'load', function() {
          GB_showPage("Hello world", "http://google.com", callback_fn);
     });

For Image

AJS.AEV(window, 'load', function() {
          GB_showImage("Hello world", "http://google.com", callback_fn);
     });

Onload of the window you would have to execute the same method that gets invoked on click, that should do the trick.

This is the syntax to get it to load in the center of the screen

<a href=“URL” title=“CAPTION” rel=“gb_page_center[WIDTH, HEIGHT]”>HTML</a>

Can’t get the two combine though.

This syntax tells me nothing, other than the fact that you have a anchor with a rel attribute (that is only read by search spiders).

Clicking on the link will take you to a specified url, where your items are centered (I think, have not checked).

Rather than scripting the centering of the page, you should style your elements in a style sheet, where you can use the text-align and/or margin properties.