Alexander Transparent,
для блоков нельзя использовать один и тотже id
Сообщение от Alexander Transparent
|
itemSelector: '#post'
|
можно класс
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
#page {
width: 100%;
}
.post {
width: 23%;
background: #fff;
padding: 2%;
margin: 15px;
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://masonry.desandro.com/masonry.pkgd.js"></script>
<script src="http://desandro.github.io/imagesloaded/imagesloaded.pkgd.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var $container = $('#page').masonry({
itemSelector: '.post',
isResizeBound: false
});;
$container.imagesLoaded( function() {
$container.masonry();
});
});
</script>
</head>
<body>
<div id="page">
<div class="post"><img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt=""></div>
<div class="post"><img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt=""></div>
<div class="post"><img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt=""></div>
<div class="post"><img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt=""></div>
<div class="post"><img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt=""></div>
</div>
</body>
</html>