1
  $("#search_button").button({
    icons: {
        "primary": 'ui-icon-search',
        "secondary": "ui-icon-triangle-1-s"
    },
});

"secondary": "ui-icon-triangle-1-s"不能添加到 "#search_button"

4

1 回答 1

0

您需要更新代码以使用新的 jquery ui 版本 1.12.0

//老的

<button>Click me</button>

$( "button" ).button( {
    icons: {
        primary: "ui-icon-lock",
        secondary: "ui-icon-gear"
    }
} );

//在新的 ui 版本 1.12.0

<button>Click me <span class="ui-icon ui-icon-gear"></span></button>

$( "button" ).button( {
    icon: "ui-icon-lock"
} );

$("#search_button" ).button( {
    icon: "ui-icon-search"
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<button id="search_button">Search <span class="ui-icon ui-icon-triangle-1-s"></span></button>

于 2017-08-05T07:18:09.023 回答