Barba: Going to a link via function with delay - Not working with barba

Created on 17 Mar 2019  路  2Comments  路  Source: barbajs/barba

Hi all,

Very excited to see v2 out!

Just wondering what's the best way transition to another page via a function?

I'd like to achieve something like this, but it won't work with barba. Probably a stupid mistake my end, but I've never done this in ajax without actually clicking links.

function goToAboutPageWithDelay () {
  setTimeout(function() {
    window.location.href = "about.html";
  }, 500);
}

  var clickAndHoldTL = new TimelineMax({
    paused:true,
    onComplete: goToAboutPageWithDelay();
 });

Cheers!

Most helpful comment

Hi @smallio,

Do not hesitate to join the Slack channel for questions about how to use barba.js. :)

All 2 comments

Hello @smallio ,
check the .go method:
https://barba.js.org/docs/v2/api/classes/core.core-1.html#go

Hi @smallio,

Do not hesitate to join the Slack channel for questions about how to use barba.js. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hugobqd picture hugobqd  路  3Comments

EmilyChews picture EmilyChews  路  3Comments

Mellis84 picture Mellis84  路  3Comments

hosxes picture hosxes  路  3Comments

ProdesignerAgency picture ProdesignerAgency  路  3Comments