Задать вопрос

Как исправить плейлист?

помогите пожалуйста как исправить плейлист когда нажимаю на 3 сезон серии исчезают
пример здесь likekino.net/...-20-seriya.html

вот js код

var pos = 0;
var poz = 0;
var sea = null;
var width = 600; 
var uvk = new Object();
 
(uvk = {
    init: function () {
        if (/likekino.net/i.test(document.domain)) {
            document.write("<div id=\"uber-vk-write\" align=\"center\">\
	 	    <ul id=\"uber-vk-season\"><li id=\"seasons\"></li></ul>\
	 	    <div id=\"uber-vk-player\"></div>\
	 	    <ul id=\"uber-vk-serial\"></ul>\
	 	    <a href=\"javascript://\" class=\"prev\" onclick=\"uvk.move(1);\">prev</a>\
	        <a href=\"javascript://\" class=\"next\" onclick=\"uvk.move(0);\">next</a>\
	        <a href=\"javascript://\" class=\"prev1\" onclick=\"uvk.movie(1);\">prev</a>\
	        <a href=\"javascript://\" class=\"next1\" onclick=\"uvk.movie(0);\">next</a>\
	        <\/div>");
        }
    },
    player: function (a, b) {
        document.getElementById("uber-vk-player").innerHTML = "";
        var uvk = document.createElement("iframe");
        uvk.src = String(a);
        uvk.width  = "680";
        uvk.height = "300";
        uvk.setAttribute("border", "0");
        uvk.setAttribute("frameborder", "0");
        uvk.setAttribute("scrolling", "no");
		uvk.setAttribute("allowFullScreen", "");
        document.getElementById("uber-vk-player").appendChild(uvk);
        if (document.getElementById("uber-vk-serial")) {
            c = document.getElementById("uber-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("uber-vk-season")) {
            c = document.getElementById("uber-vk-season").getElementsByTagName("span");
            for (var i = 0; i < c.length; i++) {
                document.getElementById("season-" + i).style.display = "none";
                c[i].removeAttribute("class");
            }
            
            d = document.getElementById("season-" + a).getElementsByTagName("span");
            for (var e = 1; e == d.length; e++) {
                document.getElementById("season-" + a).getElementsByTagName("span")[0].setAttribute("style", "display:none");
                document.getElementById("uber-vk-write").getElementsByClassName("prev1")[0].setAttribute("style", "display:none");
                document.getElementById("uber-vk-write").getElementsByClassName("next1")[0].setAttribute("style", "display:none");
            }
            document.getElementById("season-" + a).style.display = "";
            document.getElementById("season-" + a).getElementsByTagName("span")[0].click();
            document.getElementById("season-" + a).getElementsByTagName("span")[0].setAttribute("class", "active");
            if(e < d.length) {
                document.getElementById("uber-vk-write").getElementsByClassName("prev1")[0].setAttribute("style", "display:block");
                document.getElementById("uber-vk-write").getElementsByClassName("next1")[0].setAttribute("style", "display:block");
            }
            sea = a;
        }
        b.setAttribute("class", "active");
        uvk.movie(1);
    },
    show: function (a, b, c, d) {
        if(c > 1) {
            for (var i = 0; i < a; i++) {
                document.getElementById("uber-vk-serial").innerHTML += "<li id=\"season-" + i + "\"></li>";
                document.getElementById("uber-vk-season").getElementsByTagName("li")[0].innerHTML += "<span onclick=\"uvk.season('" + i + "', this)\">" + c + " Сезон</span>";
            }
            for (var i = 0; i < a; i++) {
                for (var j = 0; j < b[i].length; j++) {
                    d = (d > 1) ? d : '';
                    var h = (d || d > 1) ? j + d - 1 : j;
                    document.getElementById("season-" + i).innerHTML += "<span onclick=\"uvk.player('" + b[i][j] + "', this);\">Серия " + (h + 1) + "</span>";
                }
            }
            document.getElementById("uber-vk-season").getElementsByTagName("span")[0].setAttribute("class", "active");
            document.getElementById("uber-vk-season").getElementsByTagName("span")[0].click();
            document.getElementById("season-0").getElementsByTagName("span")[0].click();
        } else if(a.length > 1) {
            var s = a[0]-1; 
			for (var i = 0; i < a.length; i++) {
                document.getElementById("uber-vk-serial").innerHTML += "<li id=\"season-" + i + "\" style=\"display:none;\"></li>";
                document.getElementById("uber-vk-season").getElementsByTagName("li")[0].innerHTML += "<span onclick=\"uvk.season('" + i + "', this)\">" + (s + i + 1) + " Сезон</span>";
            }
            for (var i = 0; i < a.length; i++) {
                for (var j = 0; j < b[i].length; j++) {
                    d = (d > 1) ? d : '';
                    var h = (d || d > 1) ? j + d - 1 : j;
                    document.getElementById("season-" + i).innerHTML += "<span onclick=\"uvk.player('" + b[i][j] + "', this);\">Серия " + (h + 1) + "</span>";
                }
            }
            document.getElementById("uber-vk-season").getElementsByTagName("span")[0].setAttribute("class", "active");
            document.getElementById("uber-vk-season").getElementsByTagName("span")[0].click();
            document.getElementById("season-0").getElementsByTagName("span")[0].click();
            document.getElementById("season-0").style.display = "";
        } else {
            for (var i = 0; i < a; i++) {
                if(c == 0 || !c) {
                    var out = (i + 1) + " Сезон";
                } else if(c == 1) {
                    var out = "Плеер " + (i + 1);
                }
                document.getElementById("uber-vk-serial").innerHTML += "<li id=\"season-" + i + "\" style=\"display:none;\"></li>";
                document.getElementById("uber-vk-season").getElementsByTagName("li")[0].innerHTML += "<span onclick=\"uvk.season('" + i + "', this)\">" + out + "</span>";
            }
        
            for (var i = 0; i < a; i++) {
                for (var j = 0; j < b[i].length; j++) {
                    if(c == 0 || !c) {
                        var out = "Серия";
                    } else if(c == 1) {
                        var out = "Часть";
                    }
                    d = (d > 1) ? d : '';
                    var h = (d || d > 1) ? j + d - 1 : j;
                    document.getElementById("season-" + i).innerHTML += "<span onclick=\"uvk.player('" + b[i][j] + "', this);\">" + out + " " + (h + 1) + "</span>";
                }
            }
            document.getElementById("uber-vk-season").getElementsByTagName("span")[0].setAttribute("class", "active");
            document.getElementById("uber-vk-season").getElementsByTagName("span")[0].click();
            document.getElementById("season-0").getElementsByTagName("span")[0].click();
            document.getElementById("season-0").style.display = "";
        }
    },
    move: function (d) {
        var a, b;
        var butt = document.getElementById("seasons");
        var widt = butt.offsetWidth;
        var left = butt.offsetLeft;
        if (d == 0) {
            clearTimeout(a);
            b = setInterval(function () {
                pos = pos - 10;
                if (pos >= (left - width) && pos >= -(widt - width)) {
                    butt.style.left = pos + "px";
                } else clearTimeout(b);
            }, 15);
        }
 
        if (d == 1) {
            clearTimeout(b);
            b = setInterval(function () {
                pos = pos + 10;
                if (pos <= (left + width) && pos <= 0) {
                    butt.style.left = pos + "px";
                } else clearTimeout(b);
            }, 15);
        }
    },
    movie: function (d) {
        var a, b;
        var butt = document.getElementById("season-" + sea);
        var widt = butt.offsetWidth;
        var left = butt.offsetLeft;
 
        if (d == 0) {
            clearTimeout(a);
            b = setInterval(function () {
                poz = poz - 10;
                if (poz >= (left - width) && poz >= -(widt - width)) {
                    butt.style.left = poz + "px";
                } else clearTimeout(b);
            }, 15);
        }
 
        if (d == 1) {
            clearTimeout(b);
            b = setInterval(function () {
                poz = poz + 10;
                if (poz <= (left + width) && poz <= 0) {
                    butt.style.left = poz + "px";
                } else clearTimeout(b);
            }, 15);
        }
    }
});
 
function showOkno() {
    var a = "";
    $("#oknouroka").dialog({
        autoOpen: true,
        open: function (b, e) {
            a = $(this).find("iframe").attr("src")
        },
        width: 700,
        modal: true,
        dialogClass: "trai",
        beforeClose: function (b, e) {
            $(this).find("iframe").attr("src", "");
            $(this).find("iframe").attr("src", a)
        }
    })
};
  • Вопрос задан
  • 411 просмотров
Подписаться 1 Оценить 3 комментария
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

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