Trigger event on file download popup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joslin
    New Member
    • Feb 2009
    • 1

    Trigger event on file download popup

    Hi All,

    I'm facing some problem with javascript events.
    My application displays an hour glass on document.onstop .
    I want an event to be triggered when a file download option pops up so that the hour glass is hidden.

    Any help in this regards will b appreciated.
    Is there any other way of calling the hour glass function(other than document.onstop ) ??

    Thanks,
    Joslin
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I don't think you can trigger something when the download alert displays.

    To display an hour glass, change the cursor of the body to "wait". See this link.

    Comment

    • gaya3
      New Member
      • Aug 2007
      • 184

      #3
      Originally posted by joslin
      Hi All,

      I'm facing some problem with javascript events.
      My application displays an hour glass on document.onstop .
      I want an event to be triggered when a file download option pops up so that the hour glass is hidden.

      Any help in this regards will b appreciated.
      Is there any other way of calling the hour glass function(other than document.onstop ) ??

      Thanks,
      Joslin
      Joslin,
      you can also have the following sample

      Code:
      <script type="text/javascript">
      
      // Changes the cursor to an hourglass
      function cursor_wait() {
      document.body.style.cursor = 'wait';
      }
      
      // Returns the cursor to the default pointer
      function cursor_clear() {
      document.body.style.cursor = 'default';
      }
      
      // Does some arduous calculation
      function calc() {
      var dummy = 0;
      
      for (var i=0; i<1000000;i++) {
      for (var z=0; i<1000000;i++) {
      dummy = dummy + z + i;
      }
      }
      
      cursor_clear();
      }
      
      </script>
      Last edited by acoder; Feb 23 '09, 01:12 PM. Reason: Added [code] tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        That doesn't answer the question of the event being triggered when the file download pops up. Maybe the cursor could be changed when the link is clicked and changed back when the window receives focus again.

        Comment

        Working...