Не нравятся результаты поиска? Попробуйте другой поиск!
DLE FAQ » Все вопросы » Общие вопросы по PHP » Скрипт плейлиста серий, как сделать нумерацию серий в обратном порядке?

Скрипт плейлиста серий, как сделать нумерацию серий в обратном порядке?


     12.07.2015    Все вопросы » Общие вопросы по PHP    2427

вопрос
Здравствуйте, кто нибудь может помочь? У меня есть скрипт плейлиста серий, мне нужно что бы серии шли не по порядку 1 серия, 2 серия и тд, а так, что бы в начале была последняя серия а в конце первая.
Если кто нибудь сможет помочь буду очень благодарен :)

Вот сам скрипт:

var pos = 0;
var poz = 0;
var sea = null;
var width = 860;
var vk = new Object();
(vk = {
    init: function () {
        document.write("<div id=\"player-vk-write\" align=\"center\">                          <div style=\"display:none\"><ul id=\"player-vk-season\"><li id=\"seasons\"></li></ul></div>                          <div id=\"player-vk-player\"></div>                          <ul id=\"player-vk-serial\"></ul>                           <div style=\"display:none\"><a href=\"javascript://\" class=\"prev\" onclick=\"vk.move(1);\">prev</a>                          <a href=\"javascript://\" class=\"next\" onclick=\"vk.move(0);\">next</a>    </div>                       <a href=\"javascript://\" class=\"prev1\" onclick=\"vk.move1(1);\">prev</a>                          <a href=\"javascript://\" class=\"next1\" onclick=\"vk.move1(0);\">next</a>                          <\/div>")
    },
    player: function (a, b) {
        document.getElementById("player-vk-player").innerHTML = "";
        var d = document.createElement("iframe");
        d.src = String(a);
        d.width = "100%";
        d.height = "372";
        d.setAttribute("border", "0");
        d.setAttribute("frameborder", "0");
        d.setAttribute("scrolling", "no");
        d.setAttribute("allowfullscreen", "");
        d.setAttribute("webkitallowfullscreen", "");
        d.setAttribute("mozallowfullscreen", "");
        d.setAttribute("oallowfullscreen", "");
        d.setAttribute("msallowfullscreen", "");
        document.getElementById("player-vk-player").appendChild(d);
        if (document.getElementById("player-vk-serial")) {
            c = document.getElementById("player-vk-serial").getElementsByTagName("span");
            for (var i = 0; i < c.length; i++) {
                c[i].removeAttribute("class")
            }
        }
        b.setAttribute("class", "active")
    },
    season: function (a, b) {
        if (document.getElementById("player-vk-season")) {
            c = document.getElementById("player-vk-season").getElementsByTagName("span");
            for (var i = 0; i < c.length; i++) {
                document.getElementById("season" + i).style.display = "none";
                c[i].removeAttribute("class")
            }
            document.getElementById("season" + a).style.display = "";
            sea = a
        }
        b.setAttribute("class", "active")
    },
    show: function (a, b) {
        for (var i = 0; i < a; i++) {
            document.getElementById("player-vk-season").getElementsByTagName("li")[0].innerHTML += "<span onclick=\"vk.season(" + i + ", this)\">Сезон " + (i + 1) + "</span>";
            document.getElementById("player-vk-serial").innerHTML += "<li id=\"season" + i + "\" style=\"display:none;\"></li>"
        }
        for (var i = 0; i < a; i++) {
            for (var j = 0; j < b[i].length; j++) {
                document.getElementById("season" + i).innerHTML += "<span onclick=\"vk.player('" + b[i][j] + "', this);\">" + (j + 1) + " серия</span>"
            }
        }
        document.getElementById("player-vk-season").getElementsByTagName("span")[0].setAttribute("class", "active");
        document.getElementById("player-vk-season").getElementsByTagName("span")[0].click();
        document.getElementById("season0").getElementsByTagName("span")[0].click();
        document.getElementById("season0").style.display = ""
    },
    move: function (d) {
        var a, b;
        var c = document.getElementById("seasons");
        var e = c.offsetWidth;
        var f = c.offsetLeft;
        if (d == 0) {
            clearTimeout(a);
            b = setInterval(function () {
                pos = pos - 10;
                if (pos >= (f - width) && pos >= -(e - width)) {
                    c.style.left = pos + "px"
                } else clearTimeout(b)
            }, 15)
        }
        if (d == 1) {
            clearTimeout(b);
            b = setInterval(function () {
                pos = pos + 10;
                if (pos <= (f + width) && pos <= 0) {
                    c.style.left = pos + "px"
                } else clearTimeout(b)
            }, 15)
        }
    },
    move1: function (d) {
        var a, b;
        var c = document.getElementById("season" + sea);
        var e = c.offsetWidth;
        var f = c.offsetLeft;
        if (d == 0) {
            clearTimeout(a);
            b = setInterval(function () {
                poz = poz - 10;
                if (poz >= (f - width) && poz >= -(e - width)) {
                    c.style.left = poz + "px"
                } else clearTimeout(b)
            }, 15)
        }
        if (d == 1) {
            clearTimeout(b);
            b = setInterval(function () {
                poz = poz + 10;
                if (poz <= (f + width) && poz <= 0) {
                    c.style.left = poz + "px"
                } else clearTimeout(b)
            }, 15)
        }
    }
});

Ответа пока нет


3 комментария

wkino
Юзер

wkino - 14 июля 2015 00:44 -

что то все уже перепробовал, не чего не получается*(

Zaifat
Юзер

Zaifat - 15 июля 2015 03:36 -

спс за скрипт)

wkino
Юзер

wkino - 16 июля 2015 13:23 -

не за что

Чтобы комментировать - войдите или зарегистрируйтесь на сайте

Похожие вопросы

наверх