2012-02-28 54 views

回答

1

我想你必須把複選框放在表單標籤內才能讓jQuery Mobile設置它的樣式。

+0

+1打我吧 – 2012-02-28 03:58:33

0

看起來像這可能是一個錯誤。添加<form>標籤的作品,但也有創造,但需要爲checkboxradio()刷新:

JS

$('#page2').live('pageshow', function(){ 
    $("input[type='checkbox']").checkboxradio("refresh"); 
});​ 

HTML

<div data-role="page"> 
    <div data-role="header"> 
     <h1>Page One</h1> 
    </div> 
    <div data-role="content"> 
     <a href="#page2" data-role="button" data-rel="dialog">Open as Dialog</a> 
    </div> 
</div> 
<div id="page2" data-role="page"> 
    <div data-role="header"> 
     <a href="#" data-rel="back">Back</a> 
     <h1>Page Two</h1> 
    </div> 
    <div data-role="content"> 
     <form> 
      This is a dialog Box. 
      JQM seems to be not styling the below checkbox.<br> 

      <input type="checkbox" name="cb1" id="cb1" /> 
      <label for="cb1">A Checkbox</label> 
      <br> 
      A button is styled well.<br> 

      <a href="#" data-role="button">Just a Button</a> 
     </form> 
    </div> 
</div>​