简体   繁体   English

模仿jQuery UI对话框按钮样式

[英]mimic jquery ui dialog button style

Can anyone tell me what class name to specify for an html button, eg, 谁能告诉我要为html按钮指定的类名,例如,

<div id='dlg' class='dialog'>
 <input type="text" id="client" name="client" />
 <button type='button' class='WHAT_CLASS' onclick="afunction()">Cancel</button>
</div>

I want same button appearance jquery ui 'Redmond' style applies by default 我希望默认情况下应用相同的按钮外观jquery ui'Redmond'样式

$dlg.dialog({
  autoOpen: false,
  title: 'Company name',
  buttons: {
  'Cancel': function() {
    $dlg.dialog('close');
     }, ......

Thanks 谢谢

There are multiple necessary classes! 有多个必要的课程! You should use the jQuery UI functionality for that: 您应该为此使用jQuery UI功能:

$("button").button();

http://jqueryui.com/demos/button/ http://jqueryui.com/demos/button/

However, if you can't do this, the classes jQuery adds are: ui-button ui-widget ui-state-default ui-corner-all 但是,如果您不能执行此操作,则jQuery添加的类为: ui-button ui-widget ui-state-default ui-corner-all

If you have jQuery UI included in your page, then the class name is ui-button . 如果页面中包含jQuery UI,则类名称为ui-button Edit: There are other classes in addition, such as ui-state-default , etc. that will depend on the state of the button. 编辑:另外还有其他类,例如ui-state-default等,这取决于按钮的状态。 The easiest way to emulate this behavior is to not emulate it at all -- use jQuery UI as it was intended. 模拟此行为的最简单方法是完全不模拟它-按预期使用jQuery UI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM