Masonry - layoutComplete

Size
3,321 Kb
Views
8,096

How do I make an masonry - layoutcomplete?

Forked from David DeSandro's Pen Masonry - layoutComplete.. What is a masonry - layoutcomplete? How do you make a masonry - layoutcomplete? This script and codes were developed by Adrien Clerbois on 30 December 2022, Friday.

Masonry - layoutComplete Previews

Masonry - layoutComplete - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Masonry - layoutComplete</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Masonry - Toggle</h1>
<div class="toggle" data-masonry-options='{ "isFitWidth": true }'> <span class="title">Panel 1</span> <div class="panel"> <div class="chk"> <input type="checkbox"> <label>Mon text 1</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 2</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 3</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 4</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 5</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 6</label> </div> </div>
</div>
<div class="toggle"> <span class="title">Panel 1</span> <div class="panel"> <div class="chk"> <input type="checkbox"> <label>Mon text 1</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 2</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 3</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 4</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 5</label> </div> <div class="chk"> <input type="checkbox"> <label>Mon text 6</label> </div> </div>
</div>
<div id="notification"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://masonry.desandro.com/masonry.pkgd.js'></script>
<script src='https://rawgithub.com/desandro/classie/master/classie.js'></script> <script src="js/index.js"></script>
</body>
</html>

Masonry - layoutComplete - Script Codes CSS Codes

* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
}
body { font-family: sans-serif;
}
.masonry { background: #EEE; max-width: 640px;
}
/* clearfix */
.masonry:after { content: ''; display: block; clear: both;
}
.masonry .item { width: 120px; height: 60px; float: left; background: #D26; border: 2px solid #333; border-color: rgba(0, 0, 0, 0.5); border-radius: 5px;
}
.toggle { width: 80vw; background: #EEE;
}
.toggle > span { display: inline-block; padding: 5px; font-size: 1.2em; border: 1px solid black; width: 100%;
}
.toggle > span + .panel { width: 100%;
}
.toggle > span + .panel.hide-not-checked .chk.not-checked { display: none;
}
.toggle > span + .panel > .chk { float: left; width: 40vw;
}
.toggle > span + .panel > .chk input { margin-left: 10%; margin-right: 10%;
}
.item:hover { background: #A2C; border-color: white; cursor: pointer;
}
#notification { position: fixed; background: black; opacity: 0; color: white; font-size: 16px; padding: 0.5em; right: 0; top: 0;
}

Masonry - layoutComplete - Script Codes JS Codes

// https://masonry.desandro.com/masonry.pkgd.js added as external resource
// https://rawgithub.com/desandro/classie/master/classie.js added
var notifElem;
docReady( function() { $('.toggle').each(function() { var container = $(this).find('.panel')[0]; notifElem = document.querySelector('#notification'); var msnry = new Masonry(container, { "isFitWidth": true }); msnry.bindResize(); $(this).find('.title').click(function(){ var $panel = $(this).parent().find('.panel'); if($panel.hasClass('hide-not-checked')){ $panel.removeClass('hide-not-checked'); $panel.find('.not-checked').removeClass('not-checked'); } else { $panel.addClass('hide-not-checked'); $panel.find('input').each(function(){ if ($(this).prop('checked')==false){ $(this).parent().addClass('not-checked'); } }); } setTimeout(function(){ msnry.layout(); },150); }); });
});
Masonry - layoutComplete - Script Codes
Masonry - layoutComplete - Script Codes
Home Page Home
Developer Adrien Clerbois
Username AClerbois
Uploaded December 30, 2022
Rating 3
Size 3,321 Kb
Views 8,096
Do you need developer help for Masonry - layoutComplete?

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!

Adrien Clerbois (AClerbois) Script Codes
Create amazing blog posts with AI!

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!