Hello, I'm trying to implement a help layer that can be toggled on and off by clicking a help link in my page header.
I know qTip can't target live() selectors without doing some body hover trickery or something of that sort, so I assumed the easiest thing to do would be to use the beforeShow callback to test if the body has the 'help' class applied or not. Unfortunately, when I test with an alert it seems that the beforeShow function is just being called on page load and not actually 'before show' as expected. Anyone have any insights or similar past experiences?
// 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()
});
Thanks!!