Skip to content

Add of 'beforeSlideChange' method - #12

Open
chienrouge wants to merge 1 commit into
jakobholmelund:masterfrom
chienrouge:master
Open

Add of 'beforeSlideChange' method#12
chienrouge wants to merge 1 commit into
jakobholmelund:masterfrom
chienrouge:master

Conversation

@chienrouge

Copy link
Copy Markdown

Just to be able to call a custom method when the new element is about to slide in.

Just to be able to call a custom method when the new element is about to slide in.
@jakobholmelund

Copy link
Copy Markdown
Owner

Hmm could this be implemented with :once ?

@jakobholmelund

Copy link
Copy Markdown
Owner

Altso needs to be updated with newest master

@chienrouge

Copy link
Copy Markdown
Author

Hi there.
you're perfectly right. will do so straight away :)

@RiZKiT

RiZKiT commented Mar 22, 2013

Copy link
Copy Markdown
Collaborator

I'm not sure why you use an event, try the following, should work fine (the first line is the only interesting one, the others are just to show the position):

...
self.options.beforeSlideChange(activeSlide.get("morph"));
activeSlide.get("morph").start(morphOptions).chain(function(){
    self.slides[prevActiveSlideIndex].setStyle("z-index", 1);
    self.unlock();
    self.options.afterSlideChange(this);
});
...

and if you already modify the options, please add the following (you may change the name morphFx):

...
    beforeSlideChange: function(morphFx){},// empty function
    afterSlideChange: function(morphFx){}// empty function
...

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