Overlay

Looking for WET v3.1?

As of September 23, 2014, version 3.1 of the Web Experience Toolkit is no longer supported. The source code and documentation have been moved to the wet-boew-legacy repository.

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="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: