3

I am building a site with the gallery as the main feature, and I need the gallery to have "categories". I am going to load in the images via AJAX but at the moment just getting the Galleria gallery to load in different images is proving challenging. My code is as follows:

function swap_gallery() {
    var new_slideshow = [
        { image: '../images/slideshow/architecture_3.jpg' },
        { image: '../images/slideshow/report_1.jpg' }
    ];
    Galleria.get(0).load({
        data_source: new_slideshow
    });
}

When I run this function I get this error in Firebug:

Error: Load failed: no data found.

For the life of me I can't work this one out.

Danny Nimmo
  • 674
  • 7
  • 22

4 Answers4

2

Just push the new values as you would do for an array.

Galleria.get(0).push({image: '../images/slideshow/architecture_3.jpg'});

Galleria API #Manipulation http://galleria.aino.se/docs/1.2/api/methods/

defvol
  • 14,392
  • 2
  • 22
  • 32
1

This works for me in Galleria 1.2.9.

Galleria.get(0).load([
        { image: '/foo/bar/image1.jpg' },
        { image: 'image2.jpg' },
        { image: 'bacon/eggs/image3.jpg' }
    ]);
mhenry1384
  • 7,538
  • 5
  • 55
  • 74
0
Galleria.get(0).load(new_slideshow);

which is, in fact, the same as mhenrys answer

user1508976
  • 171
  • 5
0

Try dataSource: new_slideshow instead of data_source: new_slideshow

Karl-Bjørnar Øie
  • 5,554
  • 1
  • 24
  • 30