herghost Posted October 31, 2010 Share Posted October 31, 2010 Hi all, I have this: <script type="text/javascript"> $(function () { var $alert = $('#alert'); if($alert.length) { var alerttimer = window.setTimeout(function () { $alert.trigger('onload'); }, 3000); $alert.animate({height: $alert.css('line-height') || '50px'}, 200) .load(function () { window.clearTimeout(alerttimer); $alert.animate({height: '0'}, 200); }); } }); </script> Which pops out a message box when the user registers and returns to the index page. The message pops up as it should, however I cant get it to autoclose! What am I missing? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/217391-autoclose-help/ Share on other sites More sharing options...
michaellunsford Posted November 5, 2010 Share Posted November 5, 2010 Why not just put the close animation directly inside of the setTimeout? Quote Link to comment https://forums.phpfreaks.com/topic/217391-autoclose-help/#findComment-1130528 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.