Skip to main content
Inspiring
October 14, 2016
質問

Javscript Challenge #366 - How can I disable master slide buttons on certain slides?

  • October 14, 2016
  • 返信数 2.
  • 332 ビュー

Hello,

I would like to disable a couple of navigation buttons I have on my master slide on several slides in my project.

My first idea was to run the Javascript cp.disable('si41119') on slide enter and cp.enable('si41119') on slide exit. This works, but I was wondering if there was a way I could do this for all relevant slides in one fell swoop.

Any ideas?

I was thinking I could "tag" all of my slides by adding something like 'nonavigate' to the label, loop through my slides, find the slides with the tag, and deactivate the button only on this slide, but because the Captivate JS API documentation is less than thorough, I'm finding this to be a bit of a challenge.

このトピックへの返信は締め切られました。

返信数 2

TLCMediaDesign
Inspiring
October 14, 2016

Lieve, you are correct that they have no identifier in Captivate, but they do in JavaScript.

Ryan, if you know the si identifier, you could easily use the slide enter event and enable each of the buttons, then read the label and if nonavigate, disable the buttons. You don't need an exit event at all.

var interfaceObj, eventEmitterObj;

window.addEventListener( 'moduleReadyEvent', function ( e )
{
interfaceObj = e.Data;
eventEmitterObj = interfaceObj.getEventEmitter();
initializeEventListeners();
});

function initializeEventListeners()
{
if ( interfaceObj )
{
     if ( eventEmitterObj )
  {
         eventEmitterObj.addEventListener( 'CPAPI_SLIDEENTER', function ( e )
   {        
    if ( e.Data.lb.indexOf( 'nonavigate' ) != -1 )
    {
     cp.disable('si41119')
    }
    else
    {
     cp.enable('si41119')
    }
            });
  }
}
}

ryan schar作成者
Inspiring
October 14, 2016

Thanks! This looks great. I'll have to take a closer look at this Monday.

Lilybiri
Legend
October 14, 2016

Not a JS answer, so you can skip reading if you want JS.

Objects on master slides in Captivate have no ID (feature request since many versions), that is why you cannot control them by advanced actions. I wonder if you can by JS.

Alternatives:

  1. create and use duplicate master slide where you delete the buttons
  2. Use the possibility to time those shape buttons for the rest of the project, alway on top. That way they get a unique ID and you can hide/show or enable/disable them where you want. The drawback of this alternative is that a pause for a shape button on the master slide will always be at the end of the slide, whatever its duration, and that is not the case for shape buttons timed for the rest of the project.
ryan schar作成者
Inspiring
October 14, 2016

Thanks, Lilybiri. Those are some good ideas.