toymakerlabs / kenburns

A Jquery gallery featuring CSS3 hardware accelerated pan-and-zoom, Ken Burns style transitions.
161 stars 65 forks source link

dynamically change given images #10

Open mamaorha opened 10 years ago

mamaorha commented 10 years ago

i tried something like this

function newSlide(imgs) { var titles = [];

$(document).ready(function()
{
    $('#kenburns-slideshow').Kenburns(
    {
        images: imgs,
            scale:1,
            duration:8000,
            fadeSpeed:1200,
            ease3d:'cubic-bezier(0.445, 0.050, 0.550, 0.950)',
        });
});

}

but it only works for the first time, if i resend new images nothing happens...

sgaurav commented 10 years ago

you found any solution to this problem? Problem is that it is creating HTML markup on the first time and then using it from next time onward.

Interested to know if someone actually tweaked it to work with different set of images.

mamaorha commented 10 years ago

i changed the files a bit, i did managed to get it to work

sgaurav commented 10 years ago

Will it be possible for you to share snippet? Will save some work at my end.

mamaorha commented 10 years ago

function newSlide(imgs) { var titles = [];

    $(document).ready(function()
    {
        $('#kenburns-slideshow').empty();
        $('#kenburns-slideshow').Kenburns(
        {
            images: imgs,
        scale:0.45,
        duration:12000,
        fadeSpeed:1200,
        ease3d:'cubic-bezier(0.445, 0.050, 0.550, 0.950)',

        onSlideComplete: function()
        {
            $('#slide-title').html(titles[this.getSlideIndex()]);
        },

        onLoadingComplete: function()
        {
            $('#status').html("Loading Complete");
            }
        });
    });

}

this is inside kenburst.js its an alter of the function

$.fn[pluginName] = function ( options ) { return this.each(function () { var obj = $(this);
var items = $("div", obj);

        if (!$.data(this, 'plugin_' + pluginName))
        {
            $.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
        }

        else
        {
            $.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
        }
    });
}
sgaurav commented 10 years ago

working for me. thanks a ton.