$("#search_button").button({
icons: {
"primary": 'ui-icon-search',
"secondary": "ui-icon-triangle-1-s"
},
});
"secondary": "ui-icon-triangle-1-s"
无法添加到"#search_button"
答案 0 :(得分: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"
});
&#13;
<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>
&#13;