Add event that fires when entering or leaving fullscreen

smares's Avatar


23 Aug, 2012 10:00 PM


I am trying to make the slider work only in fullscreen mode. While I can fire enterFullscreen after loading, I need a way to find out when the user leaves fullscreen mode in order to destroy the slider. Can you please add such an event? Beside that, is there a better way to allow fullscreen use only?


  1. Support Staff 1 Posted by Dmytro Semenov on 24 Aug, 2012 08:50 AM

    Dmytro Semenov's Avatar


    Slider OOP architecture allows you to extend prototype and access the function directly, to create such trick:

    var slider = $('.royalSlider').data('royalSlider');
    slider.exitFullscreen = function(preventNative) {
        // do something there    
        $, preventNative);

    Please note that if you're using native fullscreen, this function may fire twice, so be sure to check for preventNative property or add flag.


  2. Dmytro Semenov closed this discussion on 26 Aug, 2012 05:20 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac