PageSourceSearch

https://www.allthetests.com/js/slider_en.js

js allthetests.com collected 2026-10-02 06:34:04 UTC 2,571 bytes, 85 lines download raw bytes

1/**
2 * Created by dizze on 08.12.2016.
3 */
4
5
6function slide2(index, id) {
7    var menu = document.getElementById(id);
8    var otherTileShown = false;
9    var tiles = [];
10    var i;
11   
12    for (i = 0; i < menu.children[0].children[0].children.length; i++)
13        tiles.push(menu.children[0].children[0].children[i]);
14    for (i = 0; i < menu.children[1].children[0].children.length; i++)
15        tiles.push(menu.children[1].children[0].children[i]);
16    for (i = 0; i < menu.children[2].children[0].children.length; i++)
17        tiles.push(menu.children[2].children[0].children[i]);
18
19    var sections = [];
20    for (i = 0; i < menu.children[0].children[1].children.length; i++)
21        sections.push(menu.children[0].children[1].children[i]);
22    for (i = 0; i < menu.children[1].children[1].children.length; i++)
23        sections.push(menu.children[1].children[1].children[i]);
24    for (i = 0; i < menu.children[2].children[1].children.length; i++)
25        sections.push(menu.children[2].children[1].children[i]);
26    
27
28    for (i = 0; i < sections.length; i++) {
29        if (isAnimRunning(sections[i]))
30            return;
31    }
32
33    //colors
34
35    for (i = 0; i < sections.length; i++) {
36        if (index == i) {
37            /*if(isHidden(sections[i])) {
38             tiles[i].firstElementChild.style.background = "#F2EFBB";
39             } else {
40             setColor(tiles[i]);
41             }*/
42
43        } else if (!isHidden(sections[i])) {
44            sections[i].classList.toggle("slide-down");
45            /*setColor(tiles[i]);*/
46            otherTileShown = true;
47        }
48    }
49
50    if (otherTileShown)
51        setTimeout(function () {
52            sections[index].classList.toggle("slide-down");
53        }, 200);
54    else
55        sections[index].classList.toggle("slide-down");
56}
57
58
59function setColor(element) {
60    if (hasClass(element, "tdcolor1"))
61        element.firstElementChild.style.background = "#eee390";
62    else if (hasClass(element, "tdcolor2"))
63        element.firstElementChild.style.background = "#DBCC81";
64    else
65        element.firstElementChild.style.background = "#E3D48A";
66}
67
68function hasClass(element, classNameToTestFor) {
69    var classNames = element.className.split(' ');
70    for (var i = 0; i < classNames.length; i++) {
71        if (classNames[i].toLowerCase() == classNameToTestFor.toLowerCase()) {
72            return true;
73        }
74    }
75    return false;
76}
77
78function isAnimRunning(section) {
79    return !isHidden(section) && section.offsetHeight < 428;
80}
81
82function isHidden(section) {
83    return (section.offsetHeight == 0)
84}
85  

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.