How can I switch a control-group (radio-group or checkbox-group) from horizontal to vertical depending on screen size?
(jQuery Mobile)
This is what I have tried so far:
pre$(document).on('pagebeforeshow',function() {
if ($(window).width() < 400) {
$("fieldset[data-type=horizontal]").attr('data-type','vertical').controlgroup('refresh',true);
} else {
$("fieldset[data-type=vertical]").attr('data-type','horizontal').controlgroup('refresh',true);
}
});/pre
It does change the data-type attribute, but the screen is not re-rendered to match.