You are here:
goToSlide Function
Goes to the specified pages and assets within a presentation.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise and Unlimited Editions with Life Sciences Cloud, Life Sciences Cloud for Customer Engagement Add-on license, and the Life Sciences Customer Engagement managed package. |
To make sure that this function opens the correct page or asset, use unique names or IDs for pages and assets within the presentation.
Syntax
PresentationPlayer.gotoSlide([PageId|PageName|SourceSystemIdentifier], slideName, animation)Arguments
| Argument | Description |
|---|---|
PageId |
The ID of a page in the presentation. If left blank, the current page is used. You can
use the |
PageName |
The name of a presentation page or asset. Use this format. |
SourceSystemIdentifier |
An optional external ID for the presentation content, typically provided when users upload presentations via the content API. Use this format. |
slideName |
The name of the slide. |
animation |
The animation to use to open the slide. These values are supported.
Swipe animations can affect performance in the presentation player. |
Usage
To reference another page in a presentation, first retrieve its page ID from the JSON.
Before you use the goToSlide function, include this code at the top of the HTML or other JavaScript code. The first line of code references the entire JSON file, while the second row gets the page ID, which is stored in a zero-based array.
var configData;
document.addEventListener('PresentationDOMContentLoaded', (event) => {
configData = event.data;
var PageId =
configData.presentations[configData.presentationIndex].Pages[1].id;
});Or, you can use this code.
var configData = {{{.}}};
var PageId = configData.presentations[confgData.presentationIndex].Pages[3].id;Then, use the goToSlide function with that ID. For example, this code is
attached to an HTML button on the presentation page.
<button onclick="PresentationPlayer.gotoSlide(PageId, '01_slide.html',null)"
class="class" type="button">Next</button>
