Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 1.11 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery Mobile Element Sizes
  2. // For all buttons use something like this
  3. $('.ui-btn').css('width','50%');
  4.  
  5. // For individual buttons use something like this
  6. $('#theButton1').parent().css('width', '75%');
  7.  
  8. // Or this for HREF data-role buttons
  9. $('#hrefButton4').css('width', '45%');
  10.        
  11. // this changes the height for all buttons
  12. $('.ui-btn-text').css('font-size','50px');
  13.  
  14. // This changes the height for a single element
  15. $('#hrefButton3').children().children().css('font-size','30px');
  16.        
  17. <div data-role="page" id="home">
  18.     <div data-role="content">
  19.         <input type="button" id="theButton1" value="Press Me 1" />
  20.         <input type="button" id="theButton2" value="Press Me 2" />
  21.         <input type="button" id="theButton3" value="Press Me 3" />
  22.         <input type="button" id="theButton4" value="Press Me 4" />
  23.         <br />
  24.         <a href="#" data-role="button" id="hrefButton1">HREF Me 1</a>
  25.         <a href="#" data-role="button" id="hrefButton2">HREF Me 2</a>
  26.         <a href="#" data-role="button" id="hrefButton3">HREF Me 3</a>
  27.         <a href="#" data-role="button" id="hrefButton4">HREF Me 4</a>
  28.     </div>
  29. </div>