Bit Brewery Lightbox features

The Bit Brewery Lightbox is equipped with special features adding to many of the usual standard functionalities. These features make our Bit Brewery Lightbox unique in comparison to other lightboxes. Particular features amongst others are as follows:

Flexible gallery function

The Bit Brewery Lightbox offers endless combination options of various media formats in one gallery, e.g. a gallery could consist of an image, an iframe, a video and another image.

Interweaving of several lightboxes

Opening up a second lightbox within the first one is completely hassle-free. The special part of it: the contents of the first lightbox are retained at all times.

User-friendly operability

The configuration of the Bit Brewery Lightbox is easy and powerful. All click areas have texts that are easily changed.

Large number of callbacks

The Bit Brewery Lightbox does not only offer the standard tracking tools of typical user activities like the opening and closing of the lightbox. Eight pre-defined callbacks make it possible to integrate further useful functionalities.

Just select the links you want to open in a lightbox, the type of the resource will be recognized by the url.

$('.bblb').bbLightbox();

Image

One of the Bit Brewery Lightbox standard tools is the integration of pictures of any size.

Example

Code for Inline Mode

<a href="/path/to/image.jpg" class="bblb">Image</a>

Code for Geek Mode

$.bbLightbox({ type: 'image', src: '/path/to/image.jpg' });

Gallery

You can connect every supported content-type to a gallery.

Example

Code for Inline Mode

<a href="/path/to/image.jpg" class="bblb" data-bblb-group="gallery" >Image</a>
						<a href="/path/to/image.jpg" class="bblb" data-bblb-group="gallery" >Image</a>
...

Code for Geek Mode

$.bbLightbox([{ type: 'image', src: '/path/to/image.jpg' }, { type: 'image', src: '/path/to/image.jpg' }, ... ]);

Gallery with preview images

You can also show preview-images but you have to define them.

Example

Code for Inline Mode

<a href="/path/to/image.jpg" class="bblb" data-bblb-group="gallery" >Image</a>
						<a href="/path/to/image.jpg" class="bblb" data-bblb-group="gallery" >Image</a>
...

Code for Geek Mode

$.bbLightbox([{ type: 'image', src: '/path/to/image.jpg' }, { type: 'image', src: '/path/to/image.jpg' }, ... ]);

Open Lightbox in full-screen mode

The Bit Brewery Lightbox can be opened in full-screen mode.

Example

Code for Inline Mode

<a href="/path/to/image.jpg" class="bblb" data-bblb-openfullscreen="true">Fullscreen</a>

Code for Geek Mode

$.bbLightbox({ type: 'image', src: '/path/to/image.jpg' }, { openfullscreen: true });

Video

Another standard option is the integration of self-hosted videos in the Bit Brewery Lightbox with SWF-fallback.
What’s special about it?
Depending on the kind of browser their own preferred video formats can alternatively be incorporated for a greater overall performance.

Example

Code for Inline Mode

<a href="/path/to/video.mp4" class="bblb" data-bblb-width="1280" data-bblb-height="720" data-bblb-formats='["/path/to/video.webm"]' data-bblb-preview="/path/to/preview.jpg">Video</a>

Code for Geek Mode

$.bbLightbox({ type: 'video', formats: ['/path/to/video.mp4', '/path/to/video.webm'], preview: '/path/to/img.jpeg' }, { width: 1280, height: 720 });

Iframe

Iframes, for instance used to embed YouTube videos or Google Maps, only need the following details for their utilization in the Bit Brewery Lightbox: the url and size in which the Lightbox shall display the iframe.

Example

Code for Inline Mode

<a href="external-url" class="bblb">Iframe</a>
<a href="internal-url" data-bblb-force="iframe" class="bblb">Iframe</a>

Code for Geek Mode

$.bbLightbox({ type: 'iframe', src: 'url' });

Open Lightbox from Lightbox

The interweaving of several Bit Brewery Lightboxes is possible at all times. For instance, if you want to use one lightbox for standard forms, links with further information (e.g. company terms and conditions) can be accessed in a second lightbox without losing the content of the first one. The content of the first lightbox will only temporarily be greyed out. When closing the second lightbox the user returns to the first one and will therefore not close the entire Lightbox-function. Further in-depth interweaving is also possible.

Example

Email Newsletter

Subscribe to receive inspiration,
ideas, and news in your inbox.

Privacy Policy

Your Privacy Policy text

Code for Inline Mode

<div id="lb-lvl1" class="bb-lightbox-htmlcontent">
	<a href="/local-url" class="bblb">Second Trigger</a>
</div>
<button class="bblb" data-bblb-content="#lb-lvl1">First Trigger</button>

Inline-HTML

You can use the Bit Brewery Lightbox to display HTML-elements of the opened website.

with selector

If you wish to display only a particular HTML element of the opened website a CSS selector can be used.

Example

Code for Inline Mode

<button data-bblb-content="selector" class="bblb">show selected element</button>

Code for Geek Mode

$.bbLightbox({ type: 'html', content: selector });

html inside trigger-element

Alternatively, the entire content of the trigger element which activates the Lightbox can be displayed. The advantage of this method is that you do not need to specify a selector.

Example

Bit Brewery
Image with HTML

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Download on Codecanyon

Code for Inline Mode

<div class="bblb">
	<button>Trigger</button>
	<div class="bb-lightbox-htmlcontent">HTML-Content</div>
</div>

Code for Geek Mode

$.bbLightbox({ type: 'html', content: 'HTML-String' });
$.bbLightbox({ type: 'html', content: jQuery|DOM - Element });

Ajax

When using AJAX the Bit Brewery Lightbox filters all CSS and JavaScript elements of the source page and only displays the body of that HTML page which is to be loaded. This works as a safety feature for the user and as a compatibility feature for the webmaster.

response (if complete html-document just body)

Example

Code for Inline Mode

<a href="/local-url" class="bblb">Ajax</a>

Code for Geek Mode

$.bbLightbox({ type: 'ajax', src: '/local-url' });

with selector

Not necessarily will the complete HTML resource be displayed when using AJAX. By using a selector one particular HTML element of the source page can be selected for display.

Example

Code for Inline Mode

<a href="/" class="bblb" data-bblb-selector=".main header">Ajax</a>

Code for Geek Mode

$.bbLightbox({ type: 'ajax', src: '/local-url', selector: '#content' });

execute css and/or js!

The standard Bit Brewery Lightbox practice of not loading CSS and JavaScript elements can be adjusted, i.e. the source page can be loaded with CSS without JavaScript, with only JavaScript excluding CSS or with either CSS or JavaScript. It is also possible to filter all css and js resources with a callback.

Example

Load page with scripts and css

If you view this demo locally (url starts with file://) in Googles Chrome Browser the ajax request will be blocked. Please visit the hosted demo to view this demo.

Code for Inline Mode

<a href="/local-url" class="bblb" data-bblb-addjs="true" data-bblb-addcss="true">Load Page with scripts and css</a>

Code for Geek Mode

$.bbLightbox({ type: 'ajax', src: '/local-url', loadcss: true, loadjs: true, selector: 'selector' });

Modal

‘Alert‘, ‚confirm‘ and ‚prompt‘ are standard JavaScript elements that are replicated within the Lightbox, i.e. you can integrate status messages by use of alert, action confirmations by use of confirm (‘yes’ or ‘no’) and newsletter subscriptions by use of prompt.

Alert

Example

Code for Inline Mode

<button data-bblb-force="modal" data-bblb-alert="Alert Text" class="bblb-alert">Alert</button>
$('.bblb-alert').bbLightbox({ contentclose: false, backgroundclose: false, fullscreen: false }).on('modal', function(e, res) { alert(res); });

Code for Geek Mode

var $el = $.bbLightbox({ type: 'modal', kind: 'alert', message:'Alert Text' }, { contentclose: false, backgroundclose: false, fullscreen: false });
$el.on('modal', function(e, res) { alert(res); });

Confirm

Example

Code for Inline Mode

<button data-bblb-force="modal" data-bblb-confirm="Confirm Text" class="bblb-confirm">Confirm</button>
$('.bblb-confirm').bbLightbox({ contentclose: false, backgroundclose: false, fullscreen: false }).on('modal', function(e, res) { alert(res); });

Code for Geek Mode

var $el = $.bbLightbox({ type: 'modal', kind: 'confirm', message: 'Confirm Text' }, { contentclose: false, backgroundclose: false, fullscreen: false });
$el.on('modal', function(e, res) { alert(res); });

Prompt

Example

Code for Inline Mode

<button id="#something" data-bblb-force="modal" data-bblb-prompt="Prompt Text" class="bblb-prompt">Prompt</button>
$('.bblb-prompt').bbLightbox({ contentclose: false, backgroundclose: false, fullscreen: false }).on('modal', function(e, res) { alert(res); });

Code for Geek Mode

var $el = $.bbLightbox({ type: 'modal', kind: 'prompt', message: 'Prompt Text' }, { contentclose: false, backgroundclose: false, fullscreen: false });
$el.on('modal', function(e, res) { alert(res); });

Error

In case of a missing resource the Bit Brewery Lightbox will automatically show an error message you can configure.

Example

Open Lightbox from Javascript

The Bit Brewery Lightbox can be activated at any point within JavaScript and therefore does not necessarily need a trigger element.

Example

Code for Geek Mode

$.bbLightbox({ type: 'image', src: '/image.jpg'; });

Open Lightbox on Load

If the hash on the url is the same as the ID of a Trigger-Element, the lightbox will be opened immediately.

Themes

Build your own theme

The name of the theme gets appended to the wrapping container of the lightbox, so you can build the style you want.

Transitions

Callbacks

As indicated above a further eight callbacks will be predefined in the Bit Brewery Lightbox (except from opening and closing the Lightbox) as follows:

Available Options

You can choose if you want to set the options inline with the data-bblb-Syntax or you can pass an option-object to the initialization.

$('.bblb').bbLightbox({
	width: 1000,
	translation: {
		slide: 'close' //options with a hyphen like "translation-slide" are nested objects
	}
});
option default description
dataprefix bblb- prefix for data-options (data-prefix-...), can only be configured through the options-object
trigger click event that opens the lightbox
theme standard [standard, classic, vintage]
inline false append lightbox html in DOM right after the trigger element instead of placing it as the last element in the DOM
fullscreen true show fullscreen button
openfullscreen false open lightbox in fullscreen mode
contentclose true show close button
backgroundclose true click on background closes lightbox
closekeys [27] array of keycodes that close the lightbox [escape]
width 800 default width for iframes and videos
height 600 default height for iframes and videos
copyevents true copy event-listeners of html-content when using a css selector to show content of the current page in the lightbox
force force a content-type when autodetection does not work, e.g. your image-urls have no file suffix
Group-Options
loop true allows sliding from first-to-last and last-to-first
preload 1 preloads x-slides before and y-slides after the current slide
defined as array [x,y], if x and y are equal can be set as integer
pager true show pager
pagergallery false show preview images, preview-images have to be specified
prevkeys [33,37,65,74] array of keycodes that close the lightbox [pageup, left, a, j]
nextkeys [34,39,68,76] array of keycodes that close the lightbox [pagedown, right, d, l]
enableswipe true change slides with slide gestures
maxswipeduration 250 duration until swipe has to be finished
minswipex 200 minimal swipe width
maxswipey 100 maximal swipe height
Animationen
transition-open growin animation on open lightbox
[fadein, slideintop, slideinright, slideinbottom, slideinleft, flipin, flipinv, growin, shrinkin]
transition-close shrinkout animation on close lightbox
[fadeout, slideouttop, slideoutright, slideoutbottom, slideoutleft, flipout, flipoutv, growout, shrinkout]
transition-slide slideslide animation on change slides
[fadeslide, slideslide, slideslidev, flipslide, flipslidev, shrinkslide]
Translations
translation-close close* Text for Close-Elements
translation-fullscreen fullscreen* Text for Fullscreen-Button
translation-previous previous* Text for Previous-Button
translation-next next* Text for Next-Button
*These texts are only visible for screen readers, but can be made visible for everyone through css
translation-alert-ok ok Text for alert-ok-button
translation-confirm-ok ok Text for confirm-ok-button
translation-confirm-cancel cancel Text for confirm-cancel-button
translation-prompt-ok ok Text for prompt-ok-button
translation-prompt-cancel cancel Text for prompt-cancel-button
translation-error Resource could not be loaded. Text for error-message
Callbacks
onbeforeopen 0 callback before open
return { stop: true } to keep lightbox from opening
onafteropen 0 callback when open
onbeforeclose 0 callback when close is called
return { stop: true } to keep lightbox from closing
onafterclose 0 callback when closed
onfilter 0 lets you customize the content-object ({ html: jQuery-Element, css: [array], js: [array] }) of a slide that has been loaded and will be inserted into the DOM
onslideloaded 0 callback when lightbox-content is created, argument is jQuery-object of the created element
onslideopen 0 callback when lightbox-content is shown, argument is jQuery-object of the element
onslideclose 0 callback when lightbox-content is hidden, argument is jQuery-object of the element