Centered Isotope masonry
How do I make an centered isotope masonry?
What is a centered isotope masonry? How do you make a centered isotope masonry? This script and codes were developed by Insprd on 13 September 2022, Tuesday.
Centered Isotope masonry - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Centered Isotope masonry</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="container"> <div class="item w1 h2"></div> <div class="item w1 h1"></div> <div class="item w1 h1"></div> <div class="item w2 h2"></div> <div class="item w1 h2"></div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://isotope.metafizzy.co/jquery.isotope.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Centered Isotope masonry - Script Codes CSS Codes
#container { padding: 5px; margin: 0 auto; border: 2px solid black;
}
.item { float: left; background: #CCC; margin: 5px; width: 50px; height: 50px;
}
.item.w2 { width: 110px; }
.item.h2 { height: 110px; }
/* no transition on .isotope container */
.isotope .isotope-item { /* change duration value to whatever you like */ -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; transition-duration: 0.8s;
}
.isotope .isotope-item { -webkit-transition-property: -webkit-transform, opacity; -moz-transition-property: -moz-transform, opacity; transition-property: transform, opacity;
}
Centered Isotope masonry - Script Codes JS Codes
$(function(){ var $container = $('#container'), $body = $('body'), colW = 60, columns = null; $container.isotope({ // disable window resizing resizable: false, masonry: { columnWidth: colW } }); $(window).smartresize(function(){ // measure the width of all the items var itemTotalWidth = 0; $container.children().each(function(){ itemTotalWidth += $(this).outerWidth(true); }); // check if columns has changed var bodyColumns = Math.floor( ( $body.width() -10 ) / colW ), itemColumns = Math.floor( itemTotalWidth / colW ), currentColumns = Math.min( bodyColumns, itemColumns ); if ( currentColumns !== columns ) { // set new column count columns = currentColumns; // apply width to container manually, then trigger relayout $container.width( columns * colW ) .isotope('reLayout'); } }).smartresize(); // trigger resize to set container width
});
Developer | Insprd |
Username | insprd |
Uploaded | September 13, 2022 |
Rating | 3 |
Size | 2,243 Kb |
Views | 58,696 |
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 |
Brick a link with CSS | 1,417 Kb |
Loading bars | 2,187 Kb |
Hover Animation from UNIQLO | 3,772 Kb |
Animated Link Underline | 1,875 Kb |
Aurora Effect | 6,624 Kb |
A Pen by insprd | 5,157 Kb |
Minimal Clock Card | 2,108 Kb |
Bolt action | 3,023 Kb |
Simple Spinning Logo Idea | 1,647 Kb |
Fading gradient button | 1,713 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 |
Birthday Party Starter | Aussieyang | 1,629 Kb |
Button fills | Zubfatal | 5,205 Kb |
The Rope | Chribbe | 2,886 Kb |
SVG Scalable Text | Said_FD | 1,451 Kb |
CSS Piano | Dannystyle | 5,138 Kb |
Sidebar Thing | Jonambas | 2,779 Kb |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
Funny menu | AxeLVaisper | 4,671 Kb |
Voting App - register | MatheusLima92 | 1,948 Kb |
GLSL Hills | Ykob | 6,991 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!