-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
.slide() method doesn't work? #254
Comments
Hi, Hard to help with your code formatting, but I can tell the slide() method does work. Could you post a JSFiddle to demonstrate ? |
Hi, it wasn't actually much of a code formatting. Merely the commands I ran at google dev-console with respective output. Here's a jsfiddle to illustrate the issue. When you press the button, it doesn't open the gallery. |
There is several issue in your code, but the general reason why it's not working is because the gallery instance has to be created (opened) before you can using methods on it. In your example you are basically trying to alter something that doesn't exist yet. There is two ways for opening the gallery programmatically (ie not by clicking on a thumbnail) : triggering a click with jQuery or using Dynamic mode (see this answer). So this would work :
See working example here. I added a "start" class to the first item in your html, but you could also give this class to the wanted item on the fly with jQuery : this would make the slide() call unnecessary and also get rid of the extra transition on the opening. Or you could use the Dynamic Mode and use the 'index' option. On a side note, don't forget methods need to be called on the instance of the gallery, not the jQuery container (your "g" variable), that is why I added a "gallery" variable in my example. |
kursusHC, Thanks a lot for taking time to explain. Perhaps a little note in the docs would help to avoid misunderstanding. Btw, the docs example suggests running method on the jquery container (and it actually works, too). |
You're right it can be a little confusing. Also yes I was wrong about the container ! Good luck. |
This thread helped me a lot. Thanks! |
Hi,
The
.slide()
method doesn't work when trying to display an image.I tried to execute it right on your demo page according to the example provided in the docs, but received an error:
Uncaught TypeError: this.$outer.find is not a function(…)
.Am I not using it right?
The text was updated successfully, but these errors were encountered: