Position of Custom Buttom | XM Community
Question

Position of Custom Buttom

  • 25 September 2020
  • 1 reply
  • 39 views

Userlevel 2
Badge +6
  • Level 2 ●●
  • 11 replies

Hi,
I have created a custom button that I want to position at middle center of the page. (I want to leave the Next button where it is bottom-right). I put together the following code from threads on this site, but it does not work. Any help to correct it would be greatly appreciated.
function createNextButton() {
var nextButtonHTML = '';
    jQuery('#Buttons').append(nextButtonHTML);
}
createNextButton();
 jQuery("#return").css({"text-align": "center", "position":"absolute", "margin-top":-890px
});




1 reply

Userlevel 7
Badge +27

Hi there, if you still need, the position of a custom button can be adjusted by wrapping the custom button in a div and centering that div with text-align. Adding the below JavaScript to a question's OnReady section will place the button in the center of that page in the survey. I also added the button styling separately.
var nextButtonHTML = '

';
jQuery('#Buttons').append(nextButtonHTML);

var buttonid = document.getElementById('return');

jQuery(buttonid).css({
"background-color": "#f44336",
"color":"white",
"padding": "8px 18px",
"border-radius": "7px"
});
CustomButtonStyling.png

Leave a Reply