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 |
Ecommerce pins | 20,290 Kb |
Testing minimal input field | 1,633 Kb |
Fixed rotated square loader test | 1,657 Kb |
Testing vertical flex | 2,131 Kb |
Test overlay | 1,907 Kb |
Albino button | 1,505 Kb |
Page slider | 2,044 Kb |
Line spinner | 1,736 Kb |
Extra canvas menu | 2,183 Kb |
Animated number transition. | 1,937 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 |
Scoreboard.js basic usage | Tbleckert | 1,733 Kb |
Cloud upload | Jaflo | 2,774 Kb |
Text Blocks Over Image, Updated | KatieK2 | 3,122 Kb |
A Pen by Alex Edwards | Exards | 8,218 Kb |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
JQuery Validate checkbox group | Lunaman | 2,466 Kb |
A Pen by Patrick Cox | Pcridesagain | 2,899 Kb |
Find The Penguin | Lelder | 2,212 Kb |
Pure CSS albums gallery | Renaudtertrais | 2,978 Kb |
Hovers with popups | Zacharyolson | 2,380 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!