未触发jquery ui css类
使用以下方法用新类更新现有css有什么区别未触发jquery ui css类,jquery,jquery-ui,Jquery,Jquery Ui,使用以下方法用新类更新现有css有什么区别 method 1: create:function () { $(this).closest(".ui-dialog").find(".ui-button").addClass('custom'); } method 2: $('#divUI').find('.ui-button').addClass('cancelButton'); 第一种方法在我的本地站点上运行良好。第二种方法在fiddle中运行良好,但在我的本地
method 1:
create:function () {
$(this).closest(".ui-dialog").find(".ui-button").addClass('custom');
}
method 2:
$('#divUI').find('.ui-button').addClass('cancelButton');
第一种方法在我的本地站点上运行良好。第二种方法在fiddle中运行良好,但在我的本地站点中不起作用
所以,有人知道为什么第二种方法在我的本地网站上不起作用,而是在小提琴上 唯一的原因是选择器
$('#divUI')
可能错误。我使用了fiddle中提供的相同代码。$(“#divparent”).find('.ui button').addClass('cancelButton');很好。困惑的