Adjust browser window to course dimensions

amak
amak 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

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    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.
  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
  • amak
    amak Community Member Posts: 23
    Thank you, that worked perfectly!
  • rgs55
    rgs55 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)
  • cjumonville3474
    cjumonville3474 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.
  • rwalters
    rwalters Community Member Posts: 276
    How are you launching the course (from an LMS, HTML page or a page created with Lectora)?
  • cjumonville3474
    cjumonville3474 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?
  • rgs55
    rgs55 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.
  • cjumonville3474
    cjumonville3474 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);
  • tila72000
    tila72000 Community Member Posts: 24
    Where do I place this code in the course? Is it after the Title or AU?
  • nwilliams3743
    nwilliams3743 Community Member Posts: 74
    Could someone post an example of this, as I too cannot seem to get this working