Register for our next webinar, 5 Keys to Unlock Storytelling in Your eLearning, where you'll learn how to unlock the magic of storytelling in your eLearning development to increase learner engagement and retention! Join Andrew Townsend, our Campaign Marketing Manager, on Thursday, December 3, 2020 at 11:00 AM MDT.

Be The First On Your Block to Rock Lectora® 21!


Apply for exclusive early access to the latest version of Lectora® Desktop v21. Seating is limited so apply now!

In need of help with your eLearning? Feel free to ask a question of the community! You can also visit our Knowledge Base or, if you're in need of immediate assistance, submit a case to our Customer Success team.

Adjust browser window to course dimensions

amakamak Community Member Posts: 23
Hi everyone,



Is there a way to resize the browser window to the dimensions of the course when it is launched?



Thanks in advance!

Comments

  • ssnegssneg Community Member Posts: 1,466
    Is the course opened in a pop-up from your LMS? If yes, there should be a setting in the LMS to select the popup size.



    However, you can also do in Lectora: On Show > Execute JavaScript > "window.resizeTo(200,200);". It will load the course and then resize it to 200px by 200px.
  • ssnegssneg Community Member Posts: 1,466
  • amakamak Community Member Posts: 23
    Thank you, that worked perfectly!
  • rgs55rgs55 Community Member Posts: 38
    I had to use "top" for it to work for me, but honestly I cannot remember why... so, this is another option if the other does not work. I also size the window slightly bigger than the course itself to accommodate for the browser title bar and border. My actual course size is: 1009 x 662

    javascript:top.window.resizeTo(1025, 730)
  • cjumonville3474cjumonville3474 Community Member Posts: 3
    This doesn't seem to work for me. Maybe I'm doing it wrong? I added an OnShowRunJS action to the Title level of:

    window.resizeTo(200,200);

    I also tried:

    top.window.resizeTo(200,200);

    Neither did anything. The windows still open up at full screen. Any advice? Did I put the JS action at the wrong level? I also tried the AU level with the same results.
  • rwaltersrwalters Community Member Posts: 276
    How are you launching the course (from an LMS, HTML page or a page created with Lectora)?
  • cjumonville3474cjumonville3474 Community Member Posts: 3
    Publishing to SCORM and launching via Cornerstone LMS.

    The LMS only allows two sizes to launch content and the setting affects all courses, so I'll have to find a way to set the window size within Lectora. Any advice?
  • rgs55rgs55 Community Member Posts: 38
    When you are publishing, make sure the checkbox for "launch course in separate window from the LMS." is checked. I set up a group at the topmost course level with two actions: 1) The action to resize the window, 2) An action to set a variable that this was done (var_WinResized > Set Equal To > yes). Then, also at the topmost course level, I have a runGroup to run that action group, IF, the window has not yet been resized (if var_WinResized > Not Equal To > yes). I do this so the resizing happens only once and does not attempt to resize each page.

    I publish to SCORM 1.2 and use Cornerstone.
  • cjumonville3474cjumonville3474 Community Member Posts: 3
    I got it to work! I had to move the "top" to the middle. No idea what this means, but thanks for the help!

    window.top.resizeTo(200,200);
  • tila72000tila72000 Community Member Posts: 24
    Where do I place this code in the course? Is it after the Title or AU?
  • nwilliams3743nwilliams3743 Community Member Posts: 74
    Could someone post an example of this, as I too cannot seem to get this working
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!

Be The First On Your Block to Rock Lectora® 21!


Apply for exclusive early access to the latest version of Lectora® Desktop v21. Seating is limited so apply now!