Skip to content

Added afterShowCallback#76

Open
acasimiro wants to merge 1 commit intozurb:masterfrom
acasimiro:639a937f2877e070dae7504b5a3b5a45951ca941
Open

Added afterShowCallback#76
acasimiro wants to merge 1 commit intozurb:masterfrom
acasimiro:639a937f2877e070dae7504b5a3b5a45951ca941

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