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

Javascript doesn't always get executed #534

Open
Stelikas opened this issue Mar 22, 2022 · 0 comments
Open

Javascript doesn't always get executed #534

Stelikas opened this issue Mar 22, 2022 · 0 comments

Comments

@Stelikas
Copy link

Stelikas commented Mar 22, 2022

I recently started using Turbolinks with pace.js to handle the initial page load and i'm facing a weird issue where sometimes Javascript doesn't get executed with no errors.

Pace.once('done', () => {
  
      var tl = gsap.timeline();

        tl.set('html, body', {
            overflowY: 'unset'
        })
        .set('#app', {
            visibility: 'visible', 
        })
        .add('do')
        .to('.turbo__lines', {
            stagger: .3,
            height: '0%'
        })
        .to('.turbo__logo, .__loader', {
            duration: .3, 
            opacity: 0
        }, 'do')
        .to('.turbo__loader', {
            visibility: 'hidden'
        }).pause();

          tl.play(); //<---Sometimes it doesn't fire
          console.log(tl) //<----Always fires
        
})

I honestly can't find a reason on why this is happening, i get no errors.

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

No branches or pull requests

1 participant