0

我正在尝试以编程方式单击还原按钮。

<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" style="white-space: nowrap;"><span class="ui-dialog-title" id="ui-dialog-title-module_scheduler" style="overflow: hidden; width: 112.21875px;"><img src="imgs/omButtons/omIcon.png" border="0" height="18"> Office Schedule</span><div class="ui-dialog-titlebar-buttonpane" style="position: absolute; top: 50%; right: 0.3em; margin-top: -10px; height: 18px;"><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button" style="position: static; top: auto; right: auto; margin: 0px;"><span class="ui-icon ui-icon-closethick">close</span></a><a class="ui-dialog-titlebar-maximize ui-corner-all" href="#" role="button" style="display: block;"><span class="ui-icon ui-icon-extlink">maximize</span></a><a class="ui-dialog-titlebar-restore ui-corner-all" href="#" role="button" style="display: block; right: 2.5em;"><span class="ui-icon ui-icon-newwin">restore</span></a><a class="ui-dialog-titlebar-minimize ui-corner-all" href="#" role="button" style="display: none;"><span class="ui-icon ui-icon-minus">minimize</span></a></div></div>

我有

$('div [aria-labelledby="ui-dialog-title-module_scheduler"]').find('a .ui-dialog-titlebar-restore').click();

但是我不是 jQuery 专家,所以我猜某处的语法是错误的?

4

2 回答 2

0

你试过了$('a.ui-dialog-titlebar-restore .ui-icon).click(function() {});吗?

于 2013-03-07T02:59:37.767 回答
0
$('div[aria-labelledby=ui-dialog-title-module_scheduler]').find('a.ui-dialog-titlebar-restore').click();

删除空格和引号,做到了。谢谢。

于 2013-03-07T01:37:05.037 回答