Automatically resize to full screen when you press the next button

I am trying to insert javascript code in qualtrics. I want him to resize the user browser after the user clicks the Next button (this is after a brief instruction that tells the user that the user browser will be resized). When I run this code with an HTML file in my own browser, it works. However, this does not work in qualtrics. I know that it captures the "NextButton" element correctly, because I tested the button with a basic warning. Does anyone know if there is anything in qualtrics that blocks this full-screen function? Is there any way around this? 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();
  }
}   

});
0
2

, NextButton Qualtrics NextButton. Qualtrics .

, , - Qualtrics NextButton , , , Qualtrics NextButton.

- :

Qualtrics.SurveyEngine.addOnload(function () {

$('NextButton').hide();
$('NextButton').insert({
    before: "<input id=\"checkButton\" type=\"button\" value=\"  >>  \" title=\"  >>  \">"
}); 
$('checkButton').onclick = function fullScreen() {
    launchIntoFullscreen(document.documentElement); 
    $('NextButton').click();
};

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();
      }
}       

});
+2

, -API Qualtrics.

- . requestFullscreen

, , requestfulscreen .

0

Source: https://habr.com/ru/post/1534943/


All Articles