2
我試圖通過單擊我的頁眉中的幫助鏈接來實現可以打開和關閉的幫助圖層。JQuery的切換幫助圖層qTip:beforeShow問題
我知道qTip無法做一些身體懸停技巧或類似的東西,因此我認爲最簡單的事情就是使用beforeShow回調來測試身體是否具有「幫助'類應用或不。不幸的是,當我使用警報測試時,似乎beforeShow函數只是在頁面加載時被調用,而不是像預期的那樣在「顯示之前」。任何人有任何見解或類似的過去經驗?
// outside of document ready function
function checkHelpLayerStatus() {
alert('things that make you go hmmmmm');
if ($('body').hasClass('help')) {
}
else {
$('.tip').qtip({disable: true});
}
}
// inside document ready function
$("#header a:contains(Help)").click(function(e) {
$('body').toggleClass('help');
e.preventDefault();
});
$("body th:contains(Test Tip)").addClass('tip').qtip({
content: 'This is an active list element',
beforeShow: checkHelpLayerStatus()
});
謝謝!!