Skip to main content

Navigation Service

The Navigation Service provides deck and presentation navigation capabilities.

Methods

goToNextSlide

Description

Navigates a deck or presentation to the next slide.

Arguments

options: Object - Options for going to the next slide.

{
loopOnNext: Boolean, // If true, navigates from the last slide to the first slide of the first chapter
ignoreRootSlide: Boolean // If true, navigates from the last slide in the last chapter to the first slide in the first chapter, skipping the root slide
}

Return Value

null

Code Example

digideckCore.navigationService.goToNextSlide(options);

goToPreviousSlide

Description

Navigates a deck or presentation to the previous slide.

Arguments

options: Object - Options for going to the previous slide.

{
loopOnPrevious: Boolean, // If true, navigates from the first slide to the last slide in the last chapter
ignoreRootSlide: Boolean // If true, skips the root slide when navigating from the first slide in the first chapter
}

Return Value

null

Code Example

digideckCore.navigationService.goToPreviousSlide(options);

goToRootSlide

Description

Navigates a deck or presentation to the root slide.

Return Value

null

Code Example

digideckCore.navigationService.goToRootSlide();

goToSlide

Description

Navigates a deck or presentation to a specific slide by its slideId (the data-id property on the slide element).

Arguments

slideId: String - The unique identifier of the slide.

Return Value

null

Code Example

digideckCore.navigationService.goToSlide(slideId);

goToFirstSlideInPresentation

Description

Navigates a presentation to the first slide in the first chapter after the root slide.

Return Value

null

Code Example

digideckCore.navigationService.goToFirstSlideInPresentation();

goToFirstSlideInChapter

Description

Navigates to the first slide in the active chapter of a deck or presentation.

Return Value

null

Code Example

digideckCore.navigationService.goToFirstSlideInChapter();

goToLastChapterSlide

Description

Navigates to the last slide in the last chapter of a deck or presentation.

Return Value

null

Code Example

digideckCore.navigationService.goToLastChapterSlide();

onNavigationEnabled

Description

Subscribes to a navigation enabled event. The callback is invoked when a presentation or deck's navigation is enabled.

Arguments

callback: Function - Function invoked when navigation becomes enabled.

Return Value

null

Code Example

digideckCore.navigationService.onNavigationEnabled((navigationEnabledEvent) => {
// Handle navigation enabled event
});

onNavigationDisabled

Description

Subscribes to a navigation disabled event. The callback is invoked when a presentation or deck's navigation is disabled.

Arguments

callback: Function - Function invoked when navigation becomes disabled.

Return Value

null

Code Example

digideckCore.navigationService.onNavigationDisabled((navigationDisabledEvent) => {
// Handle navigation disabled event
});

offNavigationEnabled

Description

Unsubscribes from the onNavigationEnabled event using the callback reference.

Arguments

callback: Function - The callback reference used to unsubscribe from the event.

Return Value

null

Code Example

digideckCore.navigationService.offNavigationEnabled(callback);

offNavigationDisabled

Description

Unsubscribes from the onNavigationDisabled event using the callback reference.

Arguments

callback: Function - The callback reference used to unsubscribe from the event.

Return Value

null

Code Example

digideckCore.navigationService.offNavigationDisabled(callback);

enableNavigation

Description

Enables navigation for a deck or presentation.

Return Value

null

Code Example

digideckCore.navigationService.enableNavigation();

disableNavigation

Description

Disables navigation for a deck or presentation.

Return Value

null

Code Example

digideckCore.navigationService.disableNavigation();

enableQuickKeys

Description

Enables keyboard quick key navigation for a deck or presentation.

Return Value

null

Code Example

digideckCore.navigationService.enableQuickKeys();

disableQuickKeys

Description

Disables keyboard quick key navigation for a deck or presentation.

Return Value

null

Code Example

digideckCore.navigationService.disableQuickKeys();

onSlideChange

Description

Subscribes to the slide change event. When Global Slide Transitions is enabled, this event fires after the out animations finish. The callback receives a Slide Object as an argument.

Arguments

callback: Function - Function invoked when a slide changes (after out animations complete).

Return Value

null

Code Example

digideckCore.navigationService.onSlideChange((slideData) => {
// Handle slide change event
});

offSlideChange

Description

Unsubscribes from the slide change event using the callback reference.

Arguments

callback: Function - The callback reference used to unsubscribe from the event.

Return Value

null

Code Example

digideckCore.navigationService.offSlideChange(callback);

onSlideChangeStart

Description

Subscribes to the event that fires when a slide change starts, before out animations are finished.

Arguments

callback: Function - Function invoked when a slide change starts.

Return Value

null

Code Example

digideckCore.navigationService.onSlideChangeStart((slideData) => {
// Handle slide change start event
});

offSlideChangeStart

Description

Unsubscribes from the slide change start event using the callback reference.

Arguments

callback: Function - The callback reference used to unsubscribe from the event.

Return Value

null

Code Example

digideckCore.navigationService.offSlideChangeStart(callback);

onSlideActive

Description

Subscribes to the event that fires when a slide change ends, after slide transition and out animations are complete.

Arguments

callback: Function - Function invoked when a slide becomes active.

Return Value

null

Code Example

digideckCore.navigationService.onSlideActive((slideData) => {
// Handle slide active event
});

offSlideActive

Description

Unsubscribes from the slide active event using the callback reference.

Arguments

callback: Function - The callback reference used to unsubscribe from the event.

Return Value

null

Code Example

digideckCore.navigationService.offSlideActive(callback);