Options can also be set programatically, by passing an options hash to the justifiedImages method. The idea behind this plugin is to keep it very flexible, so that it can be used for anytype of images source data. To keep that in mind you must set
getSize during initialization. Details about the same is given below.
|images||Mandatory||Array||This is the array which contains your images. Each image object in array could contain any data. Justified.js doesn't actually read properties of these objects, it call below mentioned functions to get what it needs. This way we keep it very flexible and customizable.|
This function is called to determine url for the thumbnail best bit for given width and height of the image.
Every photo website keeps different sizes of thumbnail, so that it can load smallest version of photo when required. You would have to override this function to return thumbnail path of the photo for given
|rowHeight||Optional Default : 150||Integer||Justified.js grid making algorithm uses this as the base size of the thumbnails and tries to fit as much thumbnail it can fit in a rows. This is just starting point for the algorithm, resulting rows height could also be slightly lesser than rowHeight.|
|maxRowHeight||Optional Default : 350||Integer||As the name suggest it is the maximum height which would be allowed. If algorithm couldn't find a way to fit any image within limit, it will crop it and place it vertically in center.|
For each thumbnail Justified.js wraps it under a div. You can override this function to create your own dom structure. This function should return the html string.
|imageContainer||Optional Default : 'photo-container'||String||It is the classname of the div which contains resulting thumbnail img. You must provide this classname if
|imageSelector||Optional Default : 'image-thumb'||String||It is the classname of the resulting thumbnail img. You must provide this classname if
|margin||Optional Default : 1||Integer||Spacing between two thumbnails, vertically and horizontally.|
Override this function if you want to append some block of html in any row. e.g. you might want to append "Add Photo" button in last row.
This function doesn't gets any argument, it sould just return an array of objects with following data format: