I have several such functions:
$(this).find('.subnav').fadeIn(200, buttonHide );
Now, buttonHide, in this case, is a function that I declared elsewhere. Once the 200 second fadeIn is complete, I want to call this function.
Great. Works in FF and Safari. However, in IE, it returns an error as undefined. Actually, I experienced a SAME problem using the onAfter function in Ariel FleslerTo scroll ... what gives?
What do I need to do for IE to be able to trigger these callbacks?
EDIT: here is the code that includes the function. This page is called AFTER the fragment above ... I'm a little noob; This is problem? Nothing starts until AFTER everything is loaded.
jQuery(function( $ ){
$('.menuClip').scrollTo( 0 );
$('body:not(.archive) .menuClip').stop().scrollTo( $('.current_page_item') );
$('.menuDown').click(function(){
$('.menuClip').stop().scrollTo( '+=70px', 800, {
onAfter:function(){
buttonHide();
},
});
});
$('.menuUp').click(function(){
$('.menuClip').stop().scrollTo( '-=70px', 800, {
onAfter:function(){
buttonHide();
},
});
});
});
$(buttonHide = function() {
setTimeout(function(){
var elemM = $(document).find('.menuClip:visible');
if (elemM[0].scrollHeight - elemM.scrollTop() == elemM.outerHeight()) {
$('.menuDown').animate({"opacity":"0"}, 200);
} else {
$('.menuDown').animate({"opacity":"1"}, 200);
}
if (elemM.scrollTop() == 0) {
$('.menuUp').animate({"opacity":"0"}, 200);
} else {
$('.menuUp').animate({"opacity":"1"}, 200);
}
}, 200);
});