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

Added afterShowCallback #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acasimiro
Copy link

I had some problems with corner detection and floated elements then I came up with a solution of adding offsetX and offsetY data attributes to <li> and then adjusting each slide position inside a callback function.

Then I noticed there is no callback to be called right after the tip is showed.
This patch, adds an simple afterShowCallback.

My callback, finally, was like this coffeescript piece of code:

$('#joyride').joyride {
  'afterShowCallback': () ->
    x  = this.$current_tip.offset().left
    y  = this.$current_tip.offset().top
    dx = this.$li.attr('data-offsetX')
    dy = this.$li.attr('data-offsetY')
    dx = if dx == 'undefined' then 0 else parseInt dx
    dy = if dy == 'undefined' then 0 else parseInt dy
    this.$current_tip.offset({left: x+dx, top: y+dy})
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant