Does anyone know of an onHide() event or something similar in jQuery?
I tried:
$(this).bind(\'hide\', function(){
console.log(\'asdasda\')
})
You can pass call back function in hide function.
function iAmCallBackForHide() {
alert('I am visible after hide');
}
$('#clickMeToHide').hide( iAmCallBackForHide );
For anyone finding this post two years later:
You know exactly when the menu is visible, right?! The CSS rule tells you. So instead of relying on onShow or onHide events, you can recreate the very same rule using jQuery and rely on the very same 'hover event':
$('ul li').hover(function () {
// Whatever you want to do 'onShow'
}, function () {
// Whatever you want to do 'onHide'
});
Also, your script now acts independent of any stylesheet, so that presentation details do not dictate website behavior (nice).