• Resolved rastavibes

    (@rastavibes)


    Wonderful plugin. Im attempting to customize but am stuck. does anyone have a suggestion? the overlay display is perfect but id like to trigger the overlay a bit differently.
    this is a link to the project page: https://ourlight.online/test4/
    is there a way to make a button in my theme single.php that triggers the overlayTrigger event and disables the hover/play icon?

    i think this is the functionality i want to trigger with the button

    /**
       * Show the overlay on-click.
       */
      function overlayTrigger(event) {
        event.preventDefault();
        var $self = $(event.currentTarget);
        var id = parseInt($self.attr('data-id'), 10);
    
        $self.openDOMWindow({
          eventType     : null,
          windowPadding : 0,
          borderSize    : 0,
          windowBGColor : 'transparent',
          overlayOpacity: fvpdata.opacity * 100,
          width : '100%',
          height: '100%'
        });
    
        // Check if the result is already cached
        if (! videoCache[id]) {
          $.post(fvpdata.ajaxurl, {
            'action'    : 'fvp_get_embed',
            'fvp_nonce' : fvpdata.nonce,
            'id'        : id
          }, function(response) {
            if (response.success) {
              // cache the result to not reload when opened again
              videoCache[id] = response.data;
    
              $('#DOMWindow').html(response.data);
              sizeLocal();
              $(window).trigger('scroll');
            }
          });
        } else {
          // From cache
          $('#DOMWindow').html( videoCache[id] );
          sizeLocal();
          $(window).trigger('scroll');
        }
      }
    
    • This topic was modified 4 years, 3 months ago by rastavibes.
    • This topic was modified 4 years, 3 months ago by rastavibes.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Trigger overlay mode from custom play button’ is closed to new replies.