jackwanders / GalleryView

jQuery plugin for creating photo galleries
MIT License
253 stars 116 forks source link

[REQUEST] Delay before start - multiple galleries ? #45

Open pepperstreet opened 11 years ago

pepperstreet commented 11 years ago

Hello, just found your demo site and script. Nice work!

I am looking for a simple gallery script/slider that can be used in 2 or 3 different places on the same page. I see one problem, all images would change in the same interval... please, correct me if i am wrong here.

Is it possible to have and set a delay per gallery? So, each gallery can have the same transition time, but will start on a different time...

Thanks for listening.

pepperstreet commented 11 years ago

Sorry, not very firm with github ;-) May I answer directly via email… Maybe "pull requests" is the better category for my question? The term sounds so strange and new to me, that i decided to write in "issues".

Multiple galleries: Thanks for the hint about the multiple usage. Got the idea!

Delay/Time offset: How to set a different start time or offset to the beginning? I mean a delay, so the different galleries would not change on the same time.

Am 16.12.2012 um 20:28 schrieb S-ed:

Each gallery can be configured individually. Example - galleryname1

config js: $('#galleryname1).galleryView({ transition_speed: 2000, transition_interval: 4000 });

images html:

But You should make sure galleries loaded simultaneously (almost). ...

— Reply to this email directly or view it on GitHub.

S-ed commented 11 years ago

Each gallery can be configured individually. Example - galleryname1

config js:

$('#galleryname1').galleryView({
    transition_speed: 2000,
    transition_interval: 4000
});

images html:

<ul id="galleryname1">
    <li><img src="http...

There is no delay function implemented yet, but you can do it by self: open jquery.galleryview-3.0-dev.js and in init: function(options,el) replace:

if(this.opts.autoplay) {
    this.startSlideshow(true);
}

to

if(this.opts.autoplay) {
    if(!this.opts.startdelay) {
        this.startSlideshow(true);
    }else{
        var parent = this;
        setTimeout(function() {
            parent.startSlideshow(true);
        }, this.opts.startdelay);
    }
}

and add "startdelay: 0,"(don't forget comma) in $.fn.galleryView.defaults like so:

autoplay: false,                //BOOLEAN - flag to start slideshow on gallery load
startdelay: 0,

now you can set any delay in config using variable "startdelay" like so:

$(function(){
    $('#myGallery').galleryView({
    enable_slideshow: true,
    autoplay: true,
    transition_interval: 1000,
    startdelay: 9000
    });
});

I've made some changes in code so don't look at code in email.

p.s.: if someone can tell me how to bypass JS scoping and call parent w/o assigning a variable i'll be glad.

pepperstreet commented 11 years ago

Thank you very much! I will give it a try, ASAP. The last file changes seem to be 9 month ago. Are you going to implement the DELAY in a future version? Thanks in advance!

S-ed commented 11 years ago

I'm not one of the dev team. =) Only if jackwanders will Transfer Ownership to someone else (i'm not one of them, i'm too lazy). Or, You can get in touch with someone who has fork. Seems like https://github.com/jeroenpx/GalleryView has more fixes than all. https://github.com/jeroenpx/GalleryView/network - you can drag that tree (and there help link above it)