Jquery-mobile can display sets of radio buttons on a horizontal grouping with the actual selection box suppressed and selection indicated by the background text colour by adding the attribute 'data-type="horizontal"'.
It can also display a vertical set, which retains the boxes and does not set the background colour, by setting 'data-type="vertical"'.
Is there a way to change the vertical styling to match the horizontal styling? That is, suppress the boxes and use the background text colour to indication selection.
FYI, we're using jquery-mobile 1.3.2.
This feature is not built into jQM, but you can make it happen with some CSS and script.
Given standard vertical markup:
I gave the controlgroup a class of
vertBackground
to make the jQuery and CSS selectors specific to this group. I apply some CSS to hide the check marks and move the text back to the left of the button:Finally I add script that checks when the radio buttons change, and add the class ui-btn-active to the label that is currently checked: