Lista de animes en emisión.
Otoño 2023
Empecemos con la instalación.
Lo primero que haremos es instalar el codigo CSS
.row {
margin: 10px -16px;
}
/* Add padding BETWEEN each column */
.row,
.row > .column {
padding: 8px;
}
/* Create three equal columns that floats next to each other */
.column {
width: 33.33%;
display: none;
}
@media screen and (max-width: 480px) {
.column {
float: left;
width: 33.33%;
}
}
@media screen and (min-width: 768px) {
.column {
width: 24.33%;
}
}
/* Clear floats after rows */
.row:after {
content: "";
display: table;
clear: both;
}
.row {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
/* Content */
.content {
/* background-color: #1b1f21; */
/* padding: 10px; */
}
.content h4 {
text-align: center;
margin: 5px 0 !important;
font-size: 14px;
font-weight: 300;
}
/* The "show" class is added to the filtered elements */
.show {
display: block;
}
/* Style the buttons */
.btn {
border: none;
outline: none;
padding: 12px 16px;
background-color: white;
cursor: pointer;
}
.btn:hover {
background-color: #ddd;
}
.btn.active {
background-color: #666;
color: white;
}
Luego agregaremos este pequeño codigo script
filterSelection("all")
function filterSelection(c) {
var x, i;
x = document.getElementsByClassName("column");
if (c == "all") c = "";
for (i = 0; i < x.length; i++) {
w3RemoveClass(x[i], "show");
if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
}
}
function w3AddClass(element, name) {
var i, arr1, arr2;
arr1 = element.className.split(" ");
arr2 = name.split(" ");
for (i = 0; i < arr2.length; i++) {
if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];}
}
}
function w3RemoveClass(element, name) {
var i, arr1, arr2;
arr1 = element.className.split(" ");
arr2 = name.split(" ");
for (i = 0; i < arr2.length; i++) {
while (arr1.indexOf(arr2[i]) > -1) {
arr1.splice(arr1.indexOf(arr2[i]), 1);
}
}
element.className = arr1.join(" ");
}
// Add active class to the current button (highlight it)
var btnContainer = document.getElementById("myBtnContainer");
var btns = btnContainer.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function(){
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
Por favor, podrias compartir la parte html, te lo agradeceria a full
ResponderBorrar