makeusabrew/bootbox — pull request #10 by kevinrenskers (2011-11-20 20:04:47+00:00)
Title: New lightbox function

I'm using bootbox to create lightbox-like image popups from thumbnails.

Markup:

Helper JS function:

$('[data-lightbox]').click(function(e) {
e.preventDefault();

var href = $(this).attr('href');
var width = $(window).width() - 80;
var height = $(window).height() - 80;
var title = '';

if ($(this).attr('title')) {
title = $(this).attr('title');
}

bootbox.lightbox('', title);
});

I've put the helper function inside another javascript file with random bits and pieces, but this could be copied to the bootbox file of course.