Prevent appearance of NextButton to alter page dimensions | XM Community
Skip to main content
Solved

Prevent appearance of NextButton to alter page dimensions

  • March 23, 2020
  • 4 replies
  • 17 views

Hi everyone, I have a simple slider question on a page(link). When the page loads I hide the next button using JS in the Qualtrics.SurveyEngine.addOnload(function()). My issue is that when all sliders are in the right position the page resizes. Is there any way, I can keep the page height/width the same so that the next button does not create this issue of resizing the page. When the Next button pops up, which sometimes changed the viewport width and throws off the slider. Thank you!

Best answer by rondev

In the code where ever there is `this.hideNextButton();` replace with below code `jQuery("#NextButton").css("visibility", "collapse");` In the code where ever there is `this.showNextButton () ;` replace with below code `jQuery("#NextButton").css("visibility", "initial");`

4 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • March 23, 2020
I guess your code is using `display:none` to hide the next button. So instead of this try using - `visibility: collapse;` to hide and `visibility: initial; `to show

  • Author
  • March 23, 2020
@rondev You are right. I am using the following code in the javascript `this.hideNextButton();` Any suggestion on how to write the `visibility: collapse;` in JS? many thanks.

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • March 23, 2020
In the code where ever there is `this.hideNextButton();` replace with below code `jQuery("#NextButton").css("visibility", "collapse");` In the code where ever there is `this.showNextButton () ;` replace with below code `jQuery("#NextButton").css("visibility", "initial");`

  • Author
  • March 23, 2020
@rondev it worked like a charm! thank you!