0
我嘗試在fancybox發生onClose事件時單擊一個按鈕。 我在想,我只是有一個語法問題,但我不完全確定。這是我的代碼。 :asp.net jquery fancybox - >在fancybox onClose事件中通過jquery觸發按鈕單擊事件
<script type="text/javascript">
var $_returnvalue = false;
$(document).ready(function() {
$(".stopNumberLnkItem").fancybox({
'width': '85%',
'height': '85%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'speedIn': 400,
'speedOut': 400,
'type': 'iframe',
'showCloseButton': true,
'onClosed': function() {
if ($_returnvalue = 'Y') {
$('#Chkbxaddto').attr('checked', 'checked');
}
$(".gridStopSelectorListLnkItem").trigger('click');
}
});
});
</script>
這是我的鏈接按鈕,我試圖通過上面的觸發器('點擊')點擊。 :
<asp:LinkButton runat="Server" ID="RefreshGridStopListButton" Text="Refresh Grid Stop List" CssClass="gridStopSelectorListLnkItem"
OnClick="RefreshGridStopListButton_Click" Font-Size="smaller" Visible="true"/>
我一直在嘗試不同的選擇器和不同的方式來執行點擊,但無濟於事。我已經加入了IE開發者工具,但似乎沒有點擊那個按鈕。任何想法在這一個將不勝感激。
謝謝。
就是這樣,我從一個鏈接按鈕變爲正常的asp按鈕,並能夠點擊它。我知道我需要另一套眼睛。謝謝Rodolfo。 –