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()
});
谢谢!!