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

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 1.45 KB  |  hits: 16  |  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. rotating posts js error in IE
  2. /*
  3.  * Version 1.0
  4.  */
  5. var $rp_timer = 0;
  6.  
  7. function rp_timer_click() {
  8.     rp_change_text(window.rp_current_post + 1);
  9.     rp_start_timer();
  10. }
  11.  
  12. function rp_start_timer() {
  13.     $rp_timer = setTimeout("rp_timer_click()", window.rp_timer_sec * 1000);
  14.     document.getElementById("rp_nav_pause").onclick = rp_stop_timer;
  15.     document.getElementById("rp_nav_pause_normal").style.display = "inline";
  16.     document.getElementById("rp_nav_pause_pressed").style.display = "none";
  17. }
  18.  
  19. function rp_stop_timer() {
  20.     clearTimeout($rp_timer);
  21.     document.getElementById("rp_nav_pause").onclick = rp_restart_timer;
  22.     document.getElementById("rp_nav_pause_normal").style.display = "none";
  23.     document.getElementById("rp_nav_pause_pressed").style.display = "inline";
  24. }
  25.  
  26. function rp_restart_timer() {
  27.     rp_timer_click();
  28. }
  29.  
  30. function rp_change_text($rp_current) {
  31.     rp_start_timer();
  32.     if ($rp_current < 0) {
  33.         $rp_current = window.rp_number_posts - 1;
  34.     }
  35.     $rp_current = $rp_current % window.rp_number_posts;
  36.     window.rp_current_post = $rp_current;
  37.     for (i = 0; i < window.rp_number_posts; i++) {
  38.         if (i == $rp_current) {
  39.             $('#rp_post' + i).fadeIn(1000);
  40.             document.getElementById('rp_nav_thumbnail' + i).className = "rp_nav_thumbnail_on";
  41.         } else {
  42.             $('#rp_post' + i).fadeOut(1000);
  43.             document.getElementById('rp_nav_thumbnail' + i).className = "rp_nav_thumbnail_off";
  44.         }
  45.     }
  46. }