I am trying to insert some javascript code into qualtrics. I want it to resize the user's browser after the user presses the "next" button (this is after a short statement telling the user that the user's browser will be resized). When I run this code with an HTML file in my own browser, it works. However, it does not work in qualtrics. I know it is grabbing the "NextButton" element correctly because I tested the button click with a basic alert. Does anyone know if there is something in qualtrics that blocks this fullscreen function? Is there a way to get around it? My Javascript code is pasted below. Thanks in advance!
Qualtrics.SurveyEngine.addOnload(function()
{
$("#NextButton").click( function()
{
alert("hi");
launchIntoFullscreen(document.documentElement);
});
function launchIntoFullscreen(element) {
if(element.requestFullscreen) {
element.requestFullscreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if(element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}
});