Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 7th, 2012  |  syntax: None  |  size: 1.58 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Delay before doing postback in javascript
  2. setInterval("__doPostBack('UpdatePanel1', '' )", 3000);
  3.        
  4. var delayb4scroll = 1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
  5.     var marqueespeed = 2 //Specify marquee scroll speed (larger is faster 1-10)
  6.     var pauseAtBottom = 3000 //Pause at the end of the scroll for this many seconds (3000 = 3 seconds)
  7.     var copyspeed = marqueespeed
  8.     var actualheight = ''
  9.     var boolRunOnce = ''
  10.  
  11.     function pageLoad() {
  12.         initializemarquee();
  13.     }
  14.  
  15.     function scrollmarquee() {
  16.         if (parseInt(cross_marquee.style.top) - 975 > (actualheight * (-1) + 8)) //if scroller hasn't reached the end of its height
  17.             cross_marquee.style.top = parseInt(cross_marquee.style.top) - copyspeed + "px" //move scroller upwards
  18.         else { //else, scrollbar has reached the bottom, display for 3 seconds then postback
  19.             setInterval("__doPostBack('UpdatePanel1', '' )", 3000);        
  20.         }
  21.     }
  22.  
  23.     function initializemarquee() {
  24.         cross_marquee = document.getElementById("vmarquee")
  25.         cross_marquee.style.top = 0
  26.         marqueeheight = document.getElementById("marqueecontainer").offsetHeight
  27.         actualheight = cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view)      
  28.         setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
  29.     }
  30.        
  31. setTimeout(function() { __doPostBack('UpdatePanel1', '' ); }, 3000);
  32.        
  33. myInterval = setInterval(function() { __doPostBack('UpdatePanel1', '' ); }, 3000);
  34. //later
  35. clearInterval(myInterval);