2011-11-28 33 views
2

我有一些單選按鈕,即Buttonset不工作有了收音機

<div class="buttonset"> 
      <input name="radio12" type="radio" class="" id="radio5" /> 
      <label class="yesno">Yes</label> 
      <input name="radio12" type="radio" class="" id="radio6" /> 
     <label class="yesno">No</label> 
</div> 

我也有這個代碼在頭

<link rel="stylesheet" ref="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-darkness/jquery-ui.css" type="text/css" media="all" /> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script> 
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script> 
<script> 
      $(document).ready(function() { 
       $(".buttonset").buttonset(); 
       alert ("Buttons created"); 
      }); 
    </script> 

而且我的單選按鈕不按預期呈現爲按鈕。

我缺少什麼?

此的jsfiddle頁有它不工作http://jsfiddle.net/jd3Km/1/

一個例子後添加資源@ soderslatt的建議,我得到這個 enter image description here

回答

2

包含了jQuery UI CSS

http://jsfiddle.net/jd3Km/5/

+0

,只有將單選按鈕更改爲看起來像一個大按鈕的div頂部。這裏沒有預期的那樣http://docs.jquery.com/UI/Button感謝Trying –

+4

調用buttonset()並將標籤關聯到它的輸入將修復它, http://jsfiddle.net/jd3Km/18/ – anderssonola