Seadragon.ButtonGroup class

Version - Back to Seadragon Ajax Library

Overview

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

Constructors

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

Properties

Name Type Description
elmt HTML Element The element representing this button group. This property is aliased; re-assigning it has no effect, but modifying it does.

Methods

Name and Signature Return Type Description
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]); viewer.addControl(navBar.elmt, Seadragon.ControlAnchor.BOTTOM_RIGHT);