вращающиеся сообщения JS ошибка в IE - PullRequest
0 голосов
/ 03 марта 2012

Мне нужно выяснить, что не так с моим кодом. Для моего сайта клиентов (http://www.comfortsolutionsinc.net/default.aspx) В IE я получаю сообщение об ошибке: Сообщение: document.getElementById (...) является нулем или не является объектом Строка: 59 Чар: 1 Код: 0 URI: http://www.comfortsolutionsinc.net/data/scripts/rotating-postsnew.js

Вот мой код JS ниже:

/*
 * Version 1.0
 */
var $rp_timer = 0;

function rp_timer_click() {
    rp_change_text(window.rp_current_post + 1);
    rp_start_timer();
}

function rp_start_timer() {
    $rp_timer = setTimeout("rp_timer_click()", window.rp_timer_sec * 1000);
    document.getElementById("rp_nav_pause").onclick = rp_stop_timer;
    document.getElementById("rp_nav_pause_normal").style.display = "inline";
    document.getElementById("rp_nav_pause_pressed").style.display = "none";
}

function rp_stop_timer() {
    clearTimeout($rp_timer);
    document.getElementById("rp_nav_pause").onclick = rp_restart_timer;
    document.getElementById("rp_nav_pause_normal").style.display = "none";
    document.getElementById("rp_nav_pause_pressed").style.display = "inline";
}

function rp_restart_timer() {
    rp_timer_click();
}

function rp_change_text($rp_current) {
    rp_start_timer();
    if ($rp_current < 0) {
        $rp_current = window.rp_number_posts - 1;
    }
    $rp_current = $rp_current % window.rp_number_posts;
    window.rp_current_post = $rp_current;
    for (i = 0; i < window.rp_number_posts; i++) {
        if (i == $rp_current) {
            $('#rp_post' + i).fadeIn(1000);
            document.getElementById('rp_nav_thumbnail' + i).className = "rp_nav_thumbnail_on";
        } else {
            $('#rp_post' + i).fadeOut(1000);
            document.getElementById('rp_nav_thumbnail' + i).className = "rp_nav_thumbnail_off";
        }
    }
}

Любые идеи / предложения будут очень полезны, заранее спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...