模仿jquery ui对话框按钮样式

时间:2022-11-01 13:39:55

Can anyone tell me what class name to specify for an html button, e.g,

任何人都可以告诉我为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

2 个解决方案

#1


1  

There are multiple necessary classes! You should use the jQuery UI functionality for that:

有多个必要的课程!您应该使用jQuery UI功能:

$("button").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

#2


0  

If you have jQuery UI included in your page, then the class name is ui-button. Edit: There are other classes in addition, such as ui-state-default, etc. that will depend on the state of the button. The easiest way to emulate this behavior is to not emulate it at all -- use jQuery UI as it was intended.

如果你的页面中包含jQuery UI,那么类名是ui-button。编辑:还有其他类,如ui-state-default等,它们将取决于按钮的状态。模拟此行为的最简单方法是根本不模拟它 - 按照预期使用jQuery UI。

#1


1  

There are multiple necessary classes! You should use the jQuery UI functionality for that:

有多个必要的课程!您应该使用jQuery UI功能:

$("button").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

#2


0  

If you have jQuery UI included in your page, then the class name is ui-button. Edit: There are other classes in addition, such as ui-state-default, etc. that will depend on the state of the button. The easiest way to emulate this behavior is to not emulate it at all -- use jQuery UI as it was intended.

如果你的页面中包含jQuery UI,那么类名是ui-button。编辑:还有其他类,如ui-state-default等,它们将取决于按钮的状态。模拟此行为的最简单方法是根本不模拟它 - 按照预期使用jQuery UI。