jackwanders/GalleryView

shopping cart

Opened this issue · 1 comments

Hi

I did some changes to the demo so it includes

  • multiple galleries
  • reading images from xml file

Demo can be seen @ www.vivid-photo.net/show/gallery/demos

The next step is adding a shopping cart to the gallery. But I'm facing a little problem. Need to get the value of the current image. Is there a way to read it from the gallery? Maybe reading of the thumbnail description?

Can this be done?

Robert

If you add an attribute to your image file like data-value="129.99", you should be able to get to it by adding a property to the gvImage object like:

var gvImage = function (img) {

    this.src = { 
        panel: img.attr('src'),
        frame: img.data('frame') || img.attr('src')
    };
    this.scale = {
        panel: null,
        frame: null
    };
    this.height = 0;
    this.width = 0;
    this.attrs = {
        title: img.attr('title') || img.attr('alt'),
        description: img.data('description')
    };
    this.href = null;
    this.dom_obj = null;

    // Add it right here
    this.value = img.data('value');

    return this;
},

Then it would be available whereever you are using an image, and the current image should be easy to get to.