开发者

jqueryui for text boxes and dropdown lists

开发者 https://www.devze.com 2023-04-04 02:44 出处:网络
The site http://jqueryui.com/demos/ describes how to set styles for buttons, 开发者_如何学JAVAradios, and checkboxes.

The site http://jqueryui.com/demos/ describes how to set styles for buttons, 开发者_如何学JAVAradios, and checkboxes.

It can be achieved by

$(".saveButton").button(
{
    icons: {
     primary: "ui-icon-disk"
    }
});

So why not TextBoxes and DropDownLists? Can I apply the button like style to text boxes and drop down lists.


I suppose a logical answer for your question is that, the widget is called "button", not "form element". There is, however, a combobox demo for the autocomplete widget, that you might find useful. Here's another demo page with the combobox without autocomplete: http://jonathan.tang.name/files/jquery_combobox/demo.html.

You may also find the jQuery UI MultiSelect Widget useful; it's a jQuery UI plugin.


As for text boxes, you can simply reuse some classes in the jQuery UI CSS framework.

See a couple of examples here: http://jsfiddle.net/william/gJh2d/1/.


Also, dropdown lists are not like links or divs or other simpler html elements (form or otherwise) they tend to have default "lower level" implementations in the browser involved with their rendering. So its much harder to change the way they look. That's why a drop down list doesn't break down to simpler elements i.e. its not a textbox with a button next to it, its a complete "thing" / "control" in itself.

However, you can reclaim control (but I'd generally say usually better to work with what you get from browser here as you can see its not simple to fully control the style such elements.

More info see resources such as e.g. enter link description here

0

精彩评论

暂无评论...
验证码 换一张
取 消