Barba: Trigger click event with jquery - no transition happens

Created on 14 Sep 2016  路  4Comments  路  Source: barbajs/barba

When I trigger a click event on a link with jquery, not transition and pageload happens.
workaround? do i have to trigger another event?
i tried Barba.Dispatcher.trigger('linkClicked', $el.find('.link').get(0)); but with no effect.
$el.find('.link').trigger('click') no effect also.

question

Most helpful comment

Hi @3oax ,
If I understood correctly you want to fire a transition/page change with JS, right?

You can do that with Barba.Pjax.goTo - http://barbajs.org/docs/Barba.Pjax.html#.goTo

Is that what you want to achieve?

All 4 comments

Hi @3oax ,
If I understood correctly you want to fire a transition/page change with JS, right?

You can do that with Barba.Pjax.goTo - http://barbajs.org/docs/Barba.Pjax.html#.goTo

Is that what you want to achieve?

yes, exactly. it works, but with an exception:
the element, which is clicked, specific transition is not fired. and i dont want to define the transition on this place.
anyway - I can live with that

@luruke I think Barba.Pjax.goTo should be documented in readme because it's quite important. Thanks.

@banago 馃憤

(Feel free to crate a pull request with it! I'm super busy in this period!)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kram08980 picture kram08980  路  3Comments

S1SYPHOS picture S1SYPHOS  路  3Comments

ershad989 picture ershad989  路  4Comments

shanewmurphy picture shanewmurphy  路  3Comments

shanewmurphy picture shanewmurphy  路  3Comments