Skip to main content

Seadragon.ButtonGroup class

Version 0.8.8 - Back to Seadragon Ajax Library


A utility class for grouping related Seadragon.Buttons. Handles activating and de-activating all buttons when the mouse enters and exits the group.


Seadragon.ButtonGroup(buttons)Creates a ButtonGroup for the given list of buttons.


elmtHTML ElementThe element representing this button group. This property is aliased; re-assigning it has no effect, but modifying it does.


Name and SignatureReturn TypeDescription
emulateEnter()-Emulates the mouse entering this button group, so that each contained button is activated.
emulateExit()-Emulates the mouse exiting this button group, so that each contained button is de-activated.

Example Usage

The following code groups together four related buttons, and adds the group's HTML element as a control to an existing Seadragon viewer. This is the technique we use for our own navigation control.

var zoomInButton = new Seadragon.Button(...);
var zoomOutButton = new Seadragon.Button(...);
var goHomeButton = new Seadragon.Button(...);
var fullPageButton = new Seadragon.Button(...);

var navBar = new Seadragon.ButtonGroup([
    zoomInButton, zoomOutButton, goHomeButton, fullPageButton]);