UPDATE:

I had set the "mousemove" event to bind to "window":

                $(document).ready(function() {
                        startTimer();
                        $(window).bind("mousemove", function()
{ resetTimer(); });
                });

That works fine in FF, but IE had some trouble with it.  Better to set
that to "document"

                $(document).ready(function() {
                        startTimer();
                        $(document).bind("mousemove", function()
{ resetTimer(); });
                });

So the full updated script:

--------------------------------------------------------
My code:
---------------------------------------------------------

        /**
         *  When the document is ready, start the timer
(startTimer();) and
         *  bind all mouse movement to "resetTimer();"
         */
                $(document).ready(function() {
                        startTimer();
                        $(document).bind("mousemove", function()
{ resetTimer(); });
                });
        /**
         *  Some vital global variables for the timer
         */
                var timerId = 0;
                var counterId = 0;

        /**
         *  Start the timer
         */
                function startTimer()
                {
                        alertTimerId    = setTimeout('refreshPage()',
15000);
                        updateCounter('15');
                }
        /**
         *  Reset the Timer
         */
                function resetTimer()
                {
                        clearTimeout ( alertTimerId );
                        clearTimeout ( counterId );
                        startTimer();
                }
        /**
         *  Refresh the Page
         */
                function refreshPage()
                {
                        var sURL = unescape(window.location.pathname);
                        window.location.replace( sURL );
                }
        /**
         *  Update the on-page Counter
         */
                function updateCounter(count)
                {
                        count = count - 1;
                        $('#timer').html(count);
                        counterId = setTimeout('updateCounter(\''+count
+'\')', 1000);
                }

Reply via email to