Adjust browser window to course dimensions
February 19, 2015 12:00 AM
Hi everyone,
Is there a way to resize the browser window to the dimensions of the course when it is launched?
Thanks in advance!
Discussion (11)
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.
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)
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.
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?
How are you launching the course (from an LMS, HTML page or a page created with Lectora)?
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 undefined 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.
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);
Where do I place this code in the course? Is it after the Title or AU?
Could someone post an example of this, as I too cannot seem to get this working
Discussions have been disabled for this post