Kris-B / nanoGALLERY

image gallery simplified - jQuery plugin. Touch enabled, responsive, justified/cascading/grid layout and it supports pulling in Flickr, Google Photos and self hosted images.
https://nanogallery2.nanostudio.org/
439 stars 101 forks source link

Any documentation on customData #68

Closed macsupport closed 9 years ago

macsupport commented 9 years ago

I see in your jsfiddle example for the info button there is the use of customData. Any documentation on this? I am interested in how it might be used with the API method. Is there a jsfiddle to show this use with your API method?

Kris-B commented 9 years ago

Actually this is an item's property defined so you can store additional data. Currently you cannot set this property directly if you use the API method to define your items.

But in the next release, I'll add support for this.

macsupport commented 9 years ago

That's great. I really would love to be able to add additional data. Great Plugin. I will be happy to buy a license.

Kris-B commented 9 years ago

Many thanks for your support! I really appreciate.

CustomData with API will be supported in v5.5.0. Usage example: {src: 'img.jpg', srct: 'imgt.jpg', title: 'image01', albumID:0, customData:{v1:1, v2:2} }

The feature is already available in the current beta version: https://raw.githubusercontent.com/Kris-B/nanoGALLERY/master/jquery.nanogallery.js

Please let me know if this is usable for you.

macsupport commented 9 years ago

One would access it with item.customData.v1?

Kris-B commented 9 years ago

Exactly.

Kris-B commented 9 years ago

v5.5.0 has been released: you can download it at https://github.com/Kris-B/nanoGALLERY/releases/tag/v5.5.0

vbanuelos commented 9 years ago

@macsupport - I was able to use JSON.stringify on an object, and attach it to the data-customdata attribute. It was then interpreted by nanogallery as an object.

image

macsupport commented 9 years ago

Can you post your code?