Forum Discussion

ornellaLR's avatar
ornellaLR
Community Member
26 days ago

STORYLINE : Opening a link in a new tab but without redirecting the learner to it

When we click on a link, we are redirected to a new tab, which causes us to leave the e-learning module page. I am concerned that the learner may not return to the e-learning page to finish it. Would it be possible that, when clicking on the link, it opens a new tab but without redirecting to it, so that the learner stays on the e-learning module page?

5 Replies

  • There's a built-in way to do this without using JavaScript. For the hyperlink on a slide, open the object trigger and then select the small "browser options" icon that is located next to the URL when hovering over it. From there, change the Window size to Custom and adjust the width of the window to be smaller (I use width: 1100, height: 800). The small window will now display on top of the bigger course window.

    Note: This will not work when using the standard Resources tab functionality. I've created a lightbox slide that acts as the Resources tab.

     

     

    • ornellaLR's avatar
      ornellaLR
      Community Member

      Thanks for this info, I didn't know that :)
      However, I'm still looking for a way to open a new tab and not a new window. The goal is to stay focus on the course without being redirected. 

  • Snorre's avatar
    Snorre
    Community Member

    You can do it using a javascript trigger:

    const url = "YOUR URL"; 
    window.open(url, '_blank');

    Or if you want a new tab, and not a new window:

    const url = "YOUR URL";
    window.open(url, '_blank').focus();

     

    • ornellaLR's avatar
      ornellaLR
      Community Member

      Hello ! Thanks for the solution but it's not working... I tried your code and it still automatically redirecting to the new tab opening...

      • Snorre's avatar
        Snorre
        Community Member

        Try adding 

        window.focus();

        after the other lines.