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

set initial slide index #396

Closed
linkit87 opened this issue Jul 23, 2014 · 9 comments
Closed

set initial slide index #396

linkit87 opened this issue Jul 23, 2014 · 9 comments

Comments

@linkit87
Copy link

Is there anyway to set initial slide to show without triggering the animation?

@gausarts
Copy link

I think this is related to:
#165

@kenwheeler
Copy link
Owner

Indeed it is

@alexrussell
Copy link

@linkit87 FWIW I hacked this with the following code in the optional array:

onInit: function () {
    setTimeout(function () {
        $('.element').slickSetOption('speed', 0).slickGoTo(4).slickSetOption('speed', 300);
    }, 10);
}

@kenwheeler
Copy link
Owner

Thanks @alexrussell

@linkit87
Copy link
Author

linkit87 commented Aug 6, 2014

Thanks @alexrussell, but this seems more like a workaround.

@alexrussell
Copy link

Oh yeah it most certainly is.

@warpraptor0
Copy link

So basically what I'm seeing in the real world and what I think I'm reading here is just that "initialSlide" doesn't work at ALL; correct?

@warpraptor0
Copy link

To paraphrase Yzma from "Emperor's New Groove":

Why do we even HAVE that option?!

Workaround above works like a charm.

@kenwheeler
Copy link
Owner

@centerlinescores its tricky. Say you have 6 slides. slidesToScroll is 3. That makes the only navigable indexes 0 and 3. So if you put initialSlide: 2, it wont work. Do you have a particular use case that isn't working for you?

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

5 participants