Improvement possible?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Oct 2005
Posts: 240
Reputation: Inny is an unknown quantity at this point 
Solved Threads: 6
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Improvement possible?

 
0
  #1
Feb 10th, 2007
This might be a big ask? can the code simply be improved in any way, sometimes it seems not to work? can it be made cross browser compat?

current code ( onsite screensaver)

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <script language="JavaScript">
  2. <!--
  3. Timeout=30000 // set delay time for effect
  4. Timer=""
  5. function oStatic() {
  6. clearTimeout(Timer)
  7. if(timerRunning == true||blurred==1){ // if win1 opened or opener is blurred, return
  8. return
  9. }
  10. timerRunning = true
  11. win1=window.open("http://herproom.5.forumer.com/index.php?act=Attach&type=post&id=7101",'','fullscreen') // if win1 not opened, open win1
  12. Timer=setTimeout("oStatic()",Timeout) // run function oStatic after delay
  13. }
  14. opened=0 // win1 not opened
  15. function oActive(){ //
  16. clearTimeout(Timer)
  17. if(opened==1){return} // if win1 opened, return
  18. timerRunning = false
  19. Timer=setTimeout("oStatic()",Timeout) // if win1 not opened run function oStatic after delay
  20. }
  21. document.onmousemove=oActive // detect mouse movement
  22. document.onmousedown=oActive // detect if button pressed
  23. document.onkeypress=oActive // detect if key press
  24. setTimeout("oActive()",1000)
  25.  
  26. //-->
  27. </script>
  28.  
  29. <BODY onblur="blurred='1'" onfocus="blurred='0';oActive()">
  30.  
  31. <script>document.write(Timeout/1000);</script>
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC