Trigger fullscreen view of the slider

⚠️ This article was created for developers!

To be able to follow the steps, you're required to have coding knowledge. If you're not a developer and can't achieve what you're looking for, consider hiring a developer.

Make sure to carefully follow the tutorial and write correct code. We're unable to provide help with custom coding, or the possible issues that are happening because of them.

1
Switch the fullscreen state
window['n2-ss-2'].controlFullscreen.switchState();

It changes the current state of the slider. If the slider is not in fullscreen mode, the code will place it there. If it's already in fullscreen mode, the code will switch the slider back to the normal state.

2
Switch to fullscreen
window['n2-ss-2'].controlFullscreen.requestFullscreen();
    

It changes the slider to fullscreen. If it's already in full screen state, the code will not have any effect.

3
Exit from fullscreen
window['n2-ss-2'].controlFullscreen.exitFullscreen();
    

It makes the slider switch back to the "normal" state. If it's already in "normal" state (so not in fullscreen) the code will not have any effect.

The 2 in the sample codes is the slider id. You need to change it to yours. (E.g. if your slider ID is 13, use n2-ss-13.)

Example usage

Making the slider switch to the other state when the swtichsliderstate button is clicked:
jQuery("#swtichsliderstate").click(function(event) {
    window['n2-ss-1'].controlFullscreen.switchState();
});
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.