I created a gallery page. It displays images with variable heights. As suggested here to use a masonry plugin i used masonry plugin. It worked great till last night.
But this morning when i checked it again i lost the alignment. No alterations done to the site since past 3 days. Here is the snapshot.
Earlier, all div's are automatically adjusted(The marked spaces were eliminated) and the display looked like
http://pinterest.com/
But all of a sudden my site lost its alignment. Unable to figure out the issue.
What might be the issue .... Please help me. In a big problem with my site
Here are the css alignment and masonry application
#body {background-color:#1c4d5c;padding:10% 0% 20% 20%;}
#imagesection
{
margin:10px 10px 10px 10px;
float:left;
width:214px;
border: 5px solid #f0f0f0;
background-color:#d2dbde;
border-radius:5px;
}
var $container = $('#body');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector : '#imagesection'
});
});
Masonry doesn't work in IE 8
Note: I am using codeigniter, Hence i am loading header, body, footer etc files in view.
Masonry layout is a layout method where one axis uses a typical strict grid layout, most often columns, and the other a masonry layout. On the masonry axis, rather than sticking to a strict grid with gaps being left after shorter items, the items in the following row rise up to completely fill the gaps.
A WordPress Masonry gallery is a popular grid layout that uses optimal spacing to place images without the need to crop them. No matter what orientation your images, the masonry gallery template in FooGallery makes your images look great.
Masonry is a grid layout based on columns. Unlike other grid layouts, it doesn't have fixed height rows. Basically, Masonry layout optimizes the use of space inside the web page by reducing any unnecessary gaps. Without this type of layout, certain restrictions are required to maintain the structure of layout.
To use masonry layout, one of your grid axes needs to have the value masonry . This will then be referred to as the masonry axis, the other axis will have rows or column tracks defined as normal, this will be the grid axis. The CSS below creates a four-column grid, with the rows set to masonry .
Try to use only required class from masonry plugin like .box .col2 ...
Other classes might effect your total alignment..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With