0

How can a flip switch be right aligned within a jQuery mobile list view?

Here's what I'm working with: http://jsfiddle.net/bthj/ry799/

The switch can be seen there clinging to the label at left, but I would like to have it on the right to make better use of space on a narrow mobile screen.

Setting "float:right" on the div.ui-slider around the switch doesn't work, the switch then floats out of the list view.

Bjorn Thor Jonsson
  • 827
  • 1
  • 10
  • 21

2 Answers2

5

This should do the trick. Live example: http://jsfiddle.net/tw16/ry799/1/

.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li {
    display: block;
    padding: 0.9em 75px 0.9em 15px;
}
div.ui-slider-switch {
    position: absolute;
    right: 0;
    width: 44%;
}
tw16
  • 29,215
  • 7
  • 63
  • 64
1
div.ui-slider-switch {
 float:right; }
Thomas
  • 43,637
  • 12
  • 109
  • 140
Mytee
  • 21
  • 2