set slider margin and showPercent as parameters.