Shadowbox.js by Michael J. I. Jackson

Version: 1.0

Support

Forum

A support forum for Shadowbox is hosted on Nabble. If you have questions about using Shadowbox or feature requests, please post them in that venue.

Browsers

Shadowbox supports the following browsers:

Quirks mode is not supported in any browser, but that doesn't necessarily mean that it won't work. If you don't know what I'm talking about, this article should help you.

Adapters

It's easy to use Shadowbox with your JavaScript library of choice for a given project. This is accomplished using adapters. An adapter is a small file that tells Shadowbox which methods to call on the underlying framework to achieve some common purpose such as querying the DOM or handling events. Shadowbox comes bundled with adapters for the following JavaScript frameworks:

In order to use Shadowbox, you must include shadowbox.css, your choice of underlying framework, the appropriate adapter, and of course shadowbox.js. For example, to use Shadowbox in combination with the Yahoo! User Interface (YUI) library, you would do the following:

<head>
<link rel="stylesheet" type="text/css" href="shadowbox.css" />
<script type="text/javascript" src="yui-utilities.js"></script>
<script type="text/javascript" src="shadowbox-yui.js"></script>
<script type="text/javascript" src="shadowbox.js"></script>
</head>

To use Shadowbox with the Prototype library, you must also include the Scriptaculous effects engine.

<head>
<link rel="stylesheet" type="text/css" href="shadowbox.css" />
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="shadowbox-prototype.js"></script>
<script type="text/javascript" src="shadowbox.js"></script>
</head>

Adapters may be found in the js/adapter/ directory, and additional adapters may be created easily by implementing the same interface. If there is currently no adapter for your favorite library, and you'd like to contribute to the project, please feel free to create your own and send it to me for inclusion in a future release.

Media

Shadowbox supports many different media formats via the Flash, QuickTime, and Windows Media Player browser plugins. Windows media files are supported on the Mac via the Flip4Mac QuickTime plugin.

Flash video is supported via Jeroen Wijering's JW FLV Player. Although Shadowbox supports many types of video, it is recommended that all video be displayed in this (FLV) format because it will have the most uniform result across different platforms. QuickTime and Windows Media Player each have their bugs and quirks that are difficult to iron out.

Shadowbox uses a smart plugin detection mechanism that automatically detects whether or not the client is capable of displaying linked content. For movies that can be played using either QuickTime or Windows Media Player, Shadowbox will automatically detect which one is installed and use it. In the case of a missing plugin, Shadowbox can either display a useful error message with a link to the appropriate plugin download page (the default behavior), or it can ignore the gallery piece altogether. See the handleUnsupported option in the options section below for more details on how to configure this behavior.

Bugs

If you think you've found a bug in the script, please let me know about it via the issue tracking system on Google Code (where this project is hosted). You'll have a much better chance of actually getting the bug fixed if it's well documented and an example is provided.