Highlighted

How do I hide and show objects on master slides with JavaScript in a fluid box project?

Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

I am trying to work out how to show and hide objects on master slides via JavaScript.

cp.hide("myObject); works but I then cannot show it with cp.show("myObject") as recommended in the documentation.

It looks like once hidden it is gone! If I enter document.getElementById("myObject"); in the browser console null is returned. I have seen a similar post on StackOverflow that was not resolved.

I have tried the same with an object added to a slide rather than master slide and get the same behaviour.

What I am trying to do is create custom navigation buttons in a responsive project using fluid boxes to overcome the serious limitations of the built-in Captivate playbar. It is proving to be far from straightforward. I hope someone can help!

Views

39

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How do I hide and show objects on master slides with JavaScript in a fluid box project?

Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

I am trying to work out how to show and hide objects on master slides via JavaScript.

cp.hide("myObject); works but I then cannot show it with cp.show("myObject") as recommended in the documentation.

It looks like once hidden it is gone! If I enter document.getElementById("myObject"); in the browser console null is returned. I have seen a similar post on StackOverflow that was not resolved.

I have tried the same with an object added to a slide rather than master slide and get the same behaviour.

What I am trying to do is create custom navigation buttons in a responsive project using fluid boxes to overcome the serious limitations of the built-in Captivate playbar. It is proving to be far from straightforward. I hope someone can help!

Views

40

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

Just pop in to tell you that I never need JS to create custom navigation and toggle buttons. But will leave you to the JS experts, know that it is 'dangerous' to offer easier ways. 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Advocate ,
Jul 28, 2020

Copy link to clipboard

Copied

Are you changing slides?

Unless you set the navigation buttons to show for the rest of the project, each object will have a new ID on each new slide and so you'll hide and show the same button however many slides ago if you use the same code. So either modify your onEnter code to reflect the new ID for each page or show the buttons for the rest of the project so that the same ID can be used.

 

 I will be honest and say that I don't work with responsive projects so I am unsure about any idiosyncrasies that might interfere with what you're trying to do or not.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Participant ,
Jul 29, 2020

Copy link to clipboard

Copied

Thank you both for your help.

I tried "Rest of slide" for buttons but this falls apart with responsive projects and fluid boxes.

I have worked around this by using a combination of the playbar, hiding the playbar thumbnail, using CPExtra to prevent scrubbing, and some SVGs as buttons on a master slide to allow the user to return to the beginning of the slide, reverse and go forward in the slide. This requires a combination of advanced actions and JavaScript.

Until such time as a slider is available for the slide timeline like that for event videos (or I can work out how to implement one that will work placed on a master slide in a responsive project with fluid boxes) this will do.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0