Explore the community Forums Lectora Tips and tricks JavaScript to control/update 2nd browser window opened from parent browser

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #283642 Score: 0
    Profile photo of shawnmac63
    shawnmac63
    Member
    @shawnmac63

    Hello. I’ve been developing in Lectora for over a year but I am a novice when it comes to JavaScript.

    A course I am working has an accessibility button on it that brings up new browser window containing the transcript of the narration. My client would like this secondary window to update the transcript info every time a user clicks the next button on the main course window bringing up the next slide. I believe this can be done with JavaScript, but I don’t know the syntax to use. The transcripts currently all have their own html page, so basically what I want to have happen is when I hit the next button on the main course page, this would also trigger the secondary html window to go to it’s next page. Any help would be greatly appreciated.

    Thanks.

    -Shawn

    #287538 Score: 0
    Profile photo of Ben Pitman
    Ben Pitman
    Member
    4 pts
    @benpitman

    Recommend you post this in the General forum area where more people look. I do not know how to do this.

    #287539 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    339 pts
    @ssneg

    Easy. The subtitles window is probably opened with something like this:
    childWindow = window.open(‘http://someurl.to.transcript_ONE’);

    To change its contents, simply reload it with a new address:
    childWindow.location.href=’http://someurl.to.transcript_TWO’

    Here’s a live demo: http://jsfiddle.net/9sk8fr72/

    If this doesn’t help you, you should probably hire a professional developer to do this.

    #287537 Score: 0
    Profile photo of Ben Pitman
    Ben Pitman
    Member
    4 pts
    @benpitman

    You can do this with Lectora actions.

    Popup windows and launching windows share the variables. Use that to control.

    In the popup page put two On Timer actions that run every say 1/2 second that check a variable.

    One to Go To Next page if variable is 1.
    One to Go To Previous page if variable is -1.

    Then also have one On Show action before these two that sets the variable to 0 so it doesn’t keep doing this.

    Then in launching window, when you want the popup to move forward or backward, just set the variable to 1 or -1,

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.