Position of Custom Buttom | XM Community
Skip to main content
Question

Position of Custom Buttom

  • September 25, 2020
  • 1 reply
  • 88 views

Forum|alt.badge.img+6
  • Level 2 ●●

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

Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • November 28, 2022

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