Add event that fires when entering or leaving fullscreen

smares's Avatar

smares

23 Aug, 2012 10:00 PM

Hi!

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?

Cheers,
Sebastian

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

    Dmitry Semenov's Avatar

    Hi,

    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    
        $.rsProto.exitFullscreen.call(this, 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.

    Dmitry

  2. Dmitry 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

Generic

? 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