Skip to main content
Inspiring
October 30, 2024
Question

Add HTML menu as webobject

  • October 30, 2024
  • 1 reply
  • 173 views

Hi
I know this is to push the concept of scorm but it would let me do so much more than what only using captivate would do.

I am  trying to add a HTML menu to captivate Classic.
It seems that Captivate is blocking tthe javascript inside the webobject.
The menu looks the way I want, is clickable but wont jump to the different slides.

This is the latest javascript I am trying.

// Function to navigate to a specific slide in Captivate from within an embedded HTML environment function navigateToSlide(slideNumber) {

if (window.parent.cpAPIInterface && typeof window.parent.cpAPIInterface.navigateToSlide === "function") { window.parent.cpAPIInterface.navigateToSlide(slideNumber); }

else { console.error("Captivate API is not available in the parent window."); } }

 

// Wait until the document is loaded, then set up event listeners document.addEventListener("DOMContentLoaded", function()

{ console.log("Menu loaded and ready to connect to Captivate."); document.querySelectorAll("#customMenu a").forEach((link, index) =>

{ link.addEventListener("click", function() { navigateToSlide(index); }); }); });

    This topic has been closed for replies.

    1 reply

    OH_CP_Lover_&_Hacker
    Inspiring
    October 31, 2024

    Hello, I should be able to help you get your project working. However, would you be open to sharing your project file with me, so that I can look at everything and get you back on track.  We can talk directly if you wish as well.  I've made a lot of projects doing things like you are attempting to do over the years.   Let me know your thoughts and feel free to message me direclty as well.   I assure you anything related to your project will be kept totally between us w - Paul

    mysk83Author
    Inspiring
    November 1, 2024

    Hi Thanks for reaching out.

    It all a test project to see how it can work out. So noproblem charing the project file. Ill dm u