Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shopping cart #29

Open
miky000 opened this issue Jul 30, 2012 · 1 comment
Open

shopping cart #29

miky000 opened this issue Jul 30, 2012 · 1 comment

Comments

@miky000
Copy link

miky000 commented Jul 30, 2012

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

@joeletherton
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants