Overlay

Purpose

A flexible, responsive overlay plugin.

Examples

Opening overlays through JavaScript

Overlays can be opened through JavaScript with:

$( "#overlayId" ).trigger( "open.wb-overlaylbx" );

For an example of opening Lightbox popups through JavaScript, see Opening popups through JavaScript.

Code

View code
HTML
<label for="overlay-select">Overlay to open</label>
<select id="overlay-select">
	<option value="left-panel">Left panel</option>
	<option value="right-panel">Right panel</option>
	<option value="top-bar">Top bar</option>
	<option value="bottom-bar">Bottom bar</option>
	<option value="mid-screen">Middle screen overlay</option>
	<option value="full-screen">Full-screen overlay</option>
	<option value="hidden-header">Full-screen overlay - Hidden header</option>
</select>
<button id="overlay-open-btn">Open overlay</button>
JavaScript
(function( $, wb ) {
"use strict";

wb.doc.on( "click vclick", "#overlay-open-btn", function( event ) {
	if ( event.stopPropagation ) {
		event.stopImmediatePropagation();
	} else {
		event.cancelBubble = true;
	}

	$( "#" + $( "#overlay-select" ).val() ).trigger( "open.wb-overlay" );
});

})( jQuery, wb );
Date modified: