944,123 Members | Top Members by Rank

Ad:
Feb 10th, 2007
0

Improvement possible?

Expand Post »
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>
Similar Threads
Reputation Points: 11
Solved Threads: 6
Posting Whiz in Training
Inny is offline Offline
293 posts
since Oct 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: get last post & display elsewhere?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Accessing objects that are not in the form fields





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC