目前我正在設計一個用戶意見頁面,我計劃從用戶那裏獲得輸入,如「它適合嗎?」如何創建一個提供用戶倍數選項的彈出窗口?
可能的輸入可以是YES/NO /否思想
如alert()
或confirm()
,prompt()
等天然對照不提供兩個以上的選項。
是否有一個本機控件,可以提供兩個以上的選項..?
如果不是,我怎樣才能創建一個使用angular-ui或jquery-ui?
目前我正在設計一個用戶意見頁面,我計劃從用戶那裏獲得輸入,如「它適合嗎?」如何創建一個提供用戶倍數選項的彈出窗口?
可能的輸入可以是YES/NO /否思想
如alert()
或confirm()
,prompt()
等天然對照不提供兩個以上的選項。
是否有一個本機控件,可以提供兩個以上的選項..?
如果不是,我怎樣才能創建一個使用angular-ui或jquery-ui?
<input type="radio" name="group1" value="yes"> Yes<br>
<input type="radio" name="group1" value="no"> No<br>
<input type="radio" name="group1" value="no_idea" checked> No Idea<br>
這只是標準的html。爲什麼你認爲它需要jQuery或角?
請至少花時間將文本與相關輸入相關聯:''(畢竟這是一個用戶界面引導的問題,即使它位於錯誤的站點上)。 – 2014-11-14 13:34:03
您可以使用jQuery UI dialog
小部件buttons
選項。
它接受一個對象,其鍵是按鈕的標籤,value是回調函數或一個定義要在按鈕上設置的屬性,屬性和事件處理程序的對象數組。
回調函數的上下文是對話框元素。您可以使用事件的target
屬性來防止您想要訪問該按鈕。
$(function() {
$("#dialog").dialog({
title:"Is it suitable?",
buttons: [{
text: "Yes",
click: function(event) {
$(this).dialog("close");
}
}, {
text: "No",
click: function(event) {
$(this).dialog("close");
}
}, {
text: "No Idea",
click: function(event) {
$(this).dialog("close");
}
}]
});
});
<link href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
如果選項是相互排斥的,使用一個''或''
這個問題似乎與題外話,因爲它是關於用戶界面的替代品,而不是「編程」。 – 2014-11-14 13:32:42
@DavidThomas,很抱歉,我應該在UX網站上發佈這個問題。 – kriznaraj 2014-11-14 13:36:11