Justified.js icon indicating copy to clipboard operation
Justified.js copied to clipboard

Image Object

Open varun-pp opened this issue 8 years ago • 1 comments

Hi,

What are the properties of image object ? what is url_s, url_n url_m, url_l url_z ? What if there is only one Url ?

Thanks

varun-pp avatar Feb 16 '18 12:02 varun-pp

I'm generating an object like this:

alle_bilder = [
    {url:'/storage/uploads/image_1.jpg', width:'1024', height:'768'},
    {url:'/storage/uploads/image_2.jpg', width:'768',  height:'1024'},
    {url:'/storage/uploads/image_3.jpg', width:'651',  height:'437'},
    {url:'/storage/uploads/image_4.jpg', width:'768',  height:'432'},
    {url:'/storage/uploads/image_5.jpg', width:'702',  height:'468'},
    {url:'/storage/uploads/image_6.jpg', width:'702',  height:'468'},
    {url:'/storage/uploads/image_7.jpg', width:'651',  height:'437'},
    {url:'/storage/uploads/image_8.jpg', width:'768',  height:'432'},
];

and in my javascript file I have this

function bildergalerie() {
	$('#justified-plugin-bildergalerie').empty().justifiedImages({
		images : alle_bilder,
		rowHeight: 200,
		maxRowHeight: 300,
		thumbnailPath: function(photo, width, height){
			return photo.url;
		},
		getSize: function(photo){
			return {width: photo.width, height: photo.height};
		},
		margin: 15
	});
}
bildergalerie();

and it works great.

If you want to get it to be responsive too just add this:

$(window).resize(bildergalerie)

Nex4rius avatar Apr 30 '18 09:04 Nex4rius