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 "this" to target slide. Fixes #42. #143

Merged
merged 1 commit into from
Apr 26, 2013

Conversation

jtwalters
Copy link
Contributor

I need to know the target slide in before/after callbacks. This lets me use "this" from within my callbacks to operate on the target (incoming) slide.

@jtwalters
Copy link
Contributor Author

@viljamis any comment? This should provide an enhancement without any disadvantage.

arielsalminen added a commit that referenced this pull request Apr 26, 2013
Set "this" to target slide. Fixes #42.
@arielsalminen arielsalminen merged commit 5928d63 into arielsalminen:master Apr 26, 2013
@arielsalminen
Copy link
Owner

Merged! :)

@telekineticyeti
Copy link

Hi, this is the same functionality I'm looking to achieve, thanks for implementing it!

I'm unsure how to access the index of the target slide in the after: callback. I've tested with the following:

 $(".carousel").responsiveSlides({
      after: function() {
        console.log( $(this) );
      });

This returns an object in the console that contains the plugin parameters - however, I can't see the reference to the slide index. Am I missing something?

Thank you!

@jtwalters
Copy link
Contributor Author

You can get the index position with this.index() — or at least an "integer indicating the position of the first element within the jQuery object relative to its sibling elements."

That should work.

@telekineticyeti
Copy link

That worked nicely, thank 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

Successfully merging this pull request may close these issues.

3 participants