简体   繁体   中英

mimic jquery ui dialog button style

Can anyone tell me what class name to specify for an html button, eg,

<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

$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:

$("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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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