Position of Custom Buttom | XM Community
Skip to main content

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



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