How to avoid to enter on FullScreen mode for a specific slide?

Michele's Avatar

Michele

08 Feb, 2022 10:20 AM

Hello,
I need to avoid a specific slide, with class "rsLinkDoc", entered on "FullScreenMode".

This is the code used but doesn't work:

<a href="link/to/file.pdf" class="rsLink rsLinkDoc"></a>
 slider.slides['.rsLinkDoc'].ev.on('rsSlideClick', function() {
    slider.exitFullscreen(); 
 });
  1. Support Staff 1 Posted by Dmytro Semenov on 08 Feb, 2022 04:52 PM

    Dmytro Semenov's Avatar

    Hello,

    You may check rsSlideClick target element like this:

    var slider = $('.royalSlider').data('royalSlider');
    slider.ev.on('rsSlideClick', function(event, originalEvent) {
        console.log(originalEvent.target);
    });
    
  2. 2 Posted by Michele on 08 Feb, 2022 06:54 PM

    Michele's Avatar

    The console gives me:

    <a href="link/to/file.pdf" target="_blank" class="rsLink rsLinkDoc"></a>
    

    But I don't know how can I avoid the fullscreen for this slide with class "rsLinkDoc".

  3. Support Staff 3 Posted by Dmytro Semenov on 08 Feb, 2022 07:43 PM

    Dmytro Semenov's Avatar

    Here is basic example:

    var slider = $('.royalSlider').data('royalSlider');
    slider.ev.on('rsSlideClick', function(event, originalEvent) {
      if (!originalEvent.target.classList.contains('rsLinkDoc')) {
        slider.enterFullscreen(); 
      }
    });
    
  4. 4 Posted by Michele on 08 Feb, 2022 08:42 PM

    Michele's Avatar

    Unfortunately, it conflicts with another instruction used for the video:

    slider.ev.on('rsSlideClick', function(){
          //slider.enterFullscreen(); 
            if(slider.isFullscreen) {
               slider.exitFullscreen();
               slider.stopVideo();
            } else {
              slider.enterFullscreen();
              slider.playVideo();
            }
          });
    

    This is the full code used:

    var slider = $('#rs-gallery-vertical').data('royalSlider');
          slider.ev.on('rsSlideClick', function(event, originalEvent) {
            if (!originalEvent.target.classList.contains('rsLinkDoc')) {
              slider.enterFullscreen();
            }
          });
          slider.ev.on('rsSlideClick', function(){
          //slider.enterFullscreen(); 
            if(slider.isFullscreen) {
               slider.exitFullscreen();
               slider.stopVideo();
            } else {
              slider.enterFullscreen();
              slider.playVideo();
            }
          });
    
  5. 5 Posted by Michele on 09 Feb, 2022 12:07 AM

    Michele's Avatar

    Fixed, thanks!

  6. Michele closed this discussion on 09 Feb, 2022 12:07 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