Grid Layout changer
How do I make an grid layout changer?
What is a grid layout changer? How do you make a grid layout changer? This script and codes were developed by Yuri Morini on 24 November 2022, Thursday.
Grid Layout changer - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Grid Layout changer</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="toolbar"> Esempi: <a href="#">1-2-3-3</a> <a href="#">4-2-1-5</a> <a href="#">2-3-4</a>
</div>
<div class="container" data-seq="1-2-3-3"> <div class="element"> <a href="#" class="product">A </a> </div> <div class="element"> <a href="#" class="product">B </a> </div> <div class="element"> <a href="#" class="product">C </a> </div> <div class="element"> <a href="#" class="product">D </a> </div> <div class="element"> <a href="#" class="product">E </a> </div> <div class="element"> <a href="#" class="product">F </a> </div> <div class="element"> <a href="#" class="product">G </a> </div> <div class="element"> <a href="#" class="product">H </a> </div> <div class="element"> <a href="#" class="product">I </a> </div> <div class="element"> <a href="#" class="product">J </a> </div> <div class="element"> <a href="#" class="product">K </a> </div> <div class="element"> <a href="#" class="product">L </a> </div> <div class="element"> <a href="#" class="product">M </a> </div> <div class="element"> <a href="#" class="product">N </a> </div> <div class="element"> <a href="#" class="product">O </a> </div> <div class="element"> <a href="#" class="product">P </a> </div> <div class="element"> <a href="#" class="product">Q </a> </div> <div class="element"> <a href="#" class="product">R </a> </div> <div class="element"> <a href="#" class="product">S </a> </div> <div class="element"> <a href="#" class="product">T </a> </div> <div class="element"> <a href="#" class="product">U </a> </div> <div class="element"> <a href="#" class="product">V </a> </div> <div class="element"> <a href="#" class="product">V </a> </div> <div class="element"> <a href="#" class="product">W </a> </div> <div class="element"> <a href="#" class="product">X </a> </div> <div class="element"> <a href="#" class="product">Y </a> </div> <div class="element"> <a href="#" class="product">Z </a> </div> <div class="element"> <a href="#" class="product"> </a> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Grid Layout changer - Script Codes CSS Codes
body, html { font-family: sans-serif; }
.toolbar { background:#eee; padding: 10px;
}
.toolbar a { display:inline-block; padding: 0 10px;
}
.container { width:100%; background:#ccc; height:100%;
}
.element { width:25%; height:300px; float:left; box-sizing:border-box; padding:10px;
}
.row-1 { width:100%;
}
.row-2 { width:50%;
}
.row-3 { width:33.3%;
}
.product { width:100%; height:100%; display: block; background: #aaa; text-align:center; text-decoration:none; color:#888; vertical-align:middle; line-height: 300px; font-size:30px; font-weight:bold;
}
Grid Layout changer - Script Codes JS Codes
changeLayout( $(".container").attr('data-seq'));
$('.toolbar a').click(function(e) { e.preventDefault(); var a = $(e.target); console.log(a.text()); changeLayout(a.text());
});
function changeLayout(input) { var elements = $(".container .element"); elements.removeClass('row-1 row-2 row-3 row-4 row-5'); var seq = input .split('-') .reduce(function(previousValue, currentValue, index, array) { for (var i = 0; i < currentValue; i++) { previousValue.push('row-' + currentValue); } return previousValue; }, []) .forEach(function(cls, index, array) { elements.eq(index).addClass(cls); });
}
Developer | Yuri Morini |
Username | yurimorini |
Uploaded | November 24, 2022 |
Rating | 3 |
Size | 2,314 Kb |
Views | 8,096 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
A Pen by Yuri Morini | 2,464 Kb |
Testing minimal input field | 1,633 Kb |
Extra canvas menu | 2,183 Kb |
Ecommerce pins | 20,290 Kb |
Foundation Reveal error | 2,048 Kb |
Faux column absolute wrapper | 1,823 Kb |
Animated number transition. | 1,937 Kb |
Test animation | 1,658 Kb |
Albino button | 1,505 Kb |
Testing vertical flex | 2,131 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
Practice using Wixel | Emnk | 3,057 Kb |
Single element checkbox | Ivijaygupta | 1,996 Kb |
Slider css only | Armandobau | 2,161 Kb |
Price table | Serluk | 5,928 Kb |
Wavy Road with Dashes | Jonobr1 | 2,679 Kb |
Polo, the flying squirrel | Agbales | 2,445 Kb |
Fixed with using Calc | Tomleo | 2,542 Kb |
A Pen by Alex Edwards | Exards | 8,218 Kb |
Navier Stoke Fluid Simulation | Esimov | 8,584 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!