• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

How to jump to a specific slide when opening one project from another with URL

New Here ,
Nov 17, 2017 Nov 17, 2017

Copy link to clipboard

Copied

Hello

I know there was an old blog regarding this back in 2011 but it does not appear to be available anymore.  I know how to call one project from another using a URL, but I can not figure out how to tell the second project what slide to jump to.  Both projects are on a web server and have been built using Captivate 2017.  Any help would be hugely appreciated.

Here is some JavaScript that I have tried in an Advanced Action of the project I want to specify the slide jump in, called in the On Enter event of the first slide in that project, but it is not working.  The bolded section will not be taken by Captivate (the script won't save if that is included.)  Not a JS expert by at all so I am not sure what is wrong with that part.

window.getQueryParamValue = function (name) var q=document.location.search||document.location.hash; if(name==null){return q;}if(q) window.getQueryParamValue = function (name){ 

          var q=document.location.search||document.location.hash; 

          if(name==null){return q;}

          if(q) {var aryParams=q.substring(1).split("&"); for(var i=0;i<aryParams.length;i++) {if(aryParams.substring(0,aryParams.indexOf("="))==name) {return aryParams.substring((aryParams.indexOf("=")+1)); 

                              } 

                    } 

          }  

return "";} 

 

if(typeof window.cp === 'undefined'){ 

          var gotoSlideNumber = getQueryParamValue('cpCmndGotoSlide'); 

          if(gotoSlideNumber != '') { 

                    document.Captivate.cpEISetValue('m_VarHandle.cpCmndGotoSlide', gotoSlideNumber -1); 

          } 

}else{ 

          window.gotoSlideNumber = window.getQueryParamValue('cpCmndGotoSlide'); 

          if(window.gotoSlideNumber != '') { 

                    window.cpCmndGotoSlide = window.gotoSlideNumber -1; 

          } 

}

Thank you

D.

Views

494

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
community guidelines
Community Expert ,
Nov 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

LATEST

It's as simple as appending a hash onto the URL you are calling:

For example, to open the subsequent Captivate file and jump to slide 4 use:

document.location ,href = 'index.html#3';

Then on slide enter of the second file, execute this script:

window.cpCmndGotoSlide = window.location.hash.substring(1, window.location.hash.length); 

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
community guidelines