By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,520 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,520 IT Pros & Developers. It's quick & easy.

Trigger event on file download popup

P: 1
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
Feb 17 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
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.
Feb 17 '09 #2

100+
P: 184
@joslin
Joslin,
you can also have the following sample

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. // Changes the cursor to an hourglass
  4. function cursor_wait() {
  5. document.body.style.cursor = 'wait';
  6. }
  7.  
  8. // Returns the cursor to the default pointer
  9. function cursor_clear() {
  10. document.body.style.cursor = 'default';
  11. }
  12.  
  13. // Does some arduous calculation
  14. function calc() {
  15. var dummy = 0;
  16.  
  17. for (var i=0; i<1000000;i++) {
  18. for (var z=0; i<1000000;i++) {
  19. dummy = dummy + z + i;
  20. }
  21. }
  22.  
  23. cursor_clear();
  24. }
  25.  
  26. </script>
Feb 23 '09 #3

acoder
Expert Mod 15k+
P: 16,027
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.
Feb 24 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.