Projects > Facebox

Facebox is a Mootools alternative to the original Facebox for jQuery.
It behaves like the pop-up windows of Facebook, and can display images, Flash, html, ...

Demo's

Simple demo

Title
Message

Terms and conditions demo

Do you agree to our terms and conditions?

Image demo

Source code for all demo's

Usage

Setup

Before you can start, you'll have to add the following files to your page :

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

Simple usage

A simple Facebox setup looks like this :

var box = new Facebox({
	title: 'Facebox title',
	message: 'My message'
});
box.show();

Open on click

To create a link that opens a Facebox window, you can use this code as an example :

<script type="text/javascript">
	function openFacebox() {   
		var box = new Facebox({
			url: 'myfile.html',
			ajaxDelay: 400
		});
		box.show();
	}
</script>
<a href="javascript: openFacebox();">Click me</a>

Modifications

Options

Extra functions