嗨,這很簡單,但我不知道該如何解決!fancybox - 將'this'傳遞給onClosed函數
if(is_logged_out(html)) {
var throughClick = $(this);
$.fancybox(html, {
'autoDimensions' : false,
'width' : 'auto',
'height' : 'auto',
'transitionIn' : 'none',
'transitionOut' : 'none',
'hideOnOverlayClick' : false,
'showCloseButton' : false,
'onClosed' :
function(throughClick) {
alert(throughClick.attr('name'));
throughClick.trigger('click');
}
});
}else{
所有我想要做的是通過哪個按鈕或鏈接被點擊的對象,所以一旦用戶重新登錄,將再次處理。
任何幫助,非常感謝。
感謝您的輸入。這個問題不在於$(this)。回到我原來的帖子,用`var throughClick ='foobar'`替換`var throughClick = $(this);`然後嘗試通過fancybox回顯**,問題仍然存在。 – 2011-02-11 09:27:04