Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未触发jquery ui css类_Jquery_Jquery Ui - Fatal编程技术网

未触发jquery ui 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中运行良好,但在我的本地

使用以下方法用新类更新现有css有什么区别

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');很好。困惑的