9d7e356c4cf7e4efb96efed23191be6d415cc272
custom.js
| ... | ... | @@ -63,33 +63,15 @@ window.onload = function() { |
| 63 | 63 | images = document.getElementsByClassName("image"); |
| 64 | 64 | |
| 65 | 65 | for (i = 0; i < images.length; i++) { |
| 66 | - w3RemoveClass(images[i], "show"); |
|
| 67 | - if (images[i].className.indexOf(page) > -1) w3AddClass(images[i], "show"); |
|
| 68 | - } |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - function w3AddClass(element, name) { |
|
| 72 | - var i, arr1, arr2; |
|
| 73 | - arr1 = element.className.split(" "); |
|
| 74 | - arr2 = name.split(" "); |
|
| 75 | - for (i = 0; i < arr2.length; i++) { |
|
| 76 | - if (arr1.indexOf(arr2[i]) == -1) { |
|
| 77 | - element.className += " " + arr2[i]; |
|
| 66 | + if(images[i].className == page) |
|
| 67 | + { |
|
| 68 | + images[i].style.display = 'block'; |
|
| 78 | 69 | } |
| 79 | - } |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - // Hide elements that are not selected |
|
| 83 | - function w3RemoveClass(element, name) { |
|
| 84 | - var i, arr1, arr2; |
|
| 85 | - arr1 = element.className.split(" "); |
|
| 86 | - arr2 = name.split(" "); |
|
| 87 | - for (i = 0; i < arr2.length; i++) { |
|
| 88 | - while (arr1.indexOf(arr2[i]) > -1) { |
|
| 89 | - arr1.splice(arr1.indexOf(arr2[i]), 1); |
|
| 70 | + else |
|
| 71 | + { |
|
| 72 | + images[i].style.display = "none"; |
|
| 73 | + } |
|
| 90 | 74 | } |
| 91 | - } |
|
| 92 | - element.className = arr1.join(" "); |
|
| 93 | 75 | } |
| 94 | 76 | |
| 95 | 77 | } |
| ... | ... | \ No newline at end of file |