Frequently Asked Questions 0.5

Q. Which of the downloaded files do I need for Greybox to work?

You only require the greybox folder inside the greybox folder for functionality, the other files are source files and documentation.

Q. Images don't show, or only show when inside greybox folder, why?

Your GB_ROOT_DIR is not set correctly.

Q. How do I make my own close anchor/button?

Look below :)

<a href="#" onclick="parent.parent.GB_hide();">My Close Button</a>

Q. How do I use Onload (Pageload) with Greybox?

The AJS library used by greybox offers it's own pageload call

AJS.AEV(window, 'load', function() {
          GB_show("Hello world", "");

Q. Greybox Extendability, overlay click close, no loading?

We create a new function called for example GB_myShow:

GB_myShow = function(caption, url, /* optional */ height, width, callback_fn) {
var options = {
caption: caption,
height: height || 500,
width: width || 500,
fullscreen: false,
overlay_click_close: true,
show_loading: false,
callback_fn: callback_fn
var win = new GB_Window(options);

The 2 self explanatory lines of interest are overlay_click_close, show_loading.
See also: Initializing objects in GreyBox

Q. How do I launch a greybox from inside an iframe?

NOTE: This only works for Iframes NOT FrameSets.
Install Greybox normally in the FrameHolder, not inside the frames.

The link inside the frame calling greybox requires the onclick approach, explained in advance_usage.html, additionally add "parent." before your Greybox of choice.

<a href="" onclick="return parent.GB_show('Google', this.href)">Visit Google</a>

Note: If you are using Sets, the var set.... must also be placed into the FrameHolder.

Q. How do I show a centered Set of a fixed/custom Size?

Answered in this Greybox Group thread
See also: Initializing objects in GreyBox

Q. How do I use Greybox together with Ajax or dynamic content?

Use the Advanced Method, onclick instead of rel, see advance_usage.html in your downloaded GreyBox package for examples.

Q. Using WordPress?

Wordpress creates sub-directories for it's webpages so when installing GreyBox use absolute paths.

<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link href="" rel="stylesheet" type="text/css" />

Q. Using Google Maps?

Use Google API, you can also check this Greybox Group thread.

Q. How do I send data back to opening window?

Use "top.window" to return data back to the 'opening' window.

Q. It wont work with websites made in dreamweaver?

Remove the function MM_imagePreloader from scripts and change the

<body onload=....> to just <body>.

If you still want to preload images you can use the included preloader from GreyBox library AJS.


Q. Known Incompatible Browser Extensions?

BitComet's IE BHO toolbar

Powered by Skeletonz