question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

refreshHard not working on disabled: mobile

See original GitHub issue

I found this using Barba.js (PJAX), but tried just loading new elements in the DOM and using refreshHard(). If the elements have an AOS attribute, then the styling will still be there (opacity: 0).

I currently have a workaround to just run .init() again whenever anything new comes into the DOM, but it seems like refreshHard() should do this.

This is:

  • Bug

Specifications

  • AOS version: 2.3.4
  • OS: Mac OS Catalina
  • Browser: Chrome

Expected Behavior

refreshHard should remove AOS attributes when new elements are added to the DOM when disabled.

Actual Behavior

Elements remain with initial AOS styling.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

4reactions
thomasvaethcommented, Feb 27, 2020

@namesjamesryan Are you using Barba V2? I just had to run .init() again.

function inits() {
    AOS.init({
        duration: 1000,
        easing: 'ease',
        once: true
    });
}

barba.hooks.afterOnce(() => {
    inits();
});

barba.hooks.after(() => {
    inits();
});

https://github.com/thomasvaeth/thomasvaeth.github.io/blob/master/_assets/js/_inits.js

1reaction
thomasvaethcommented, Apr 20, 2020

I was using AOS v2.3.4 for all the projects I was using Barba v2. I know he changed AOS v3 a lot, so maybe try v2 until there is a stable release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aos - JavaScripting.com
init - initialize AOS; refresh - recalculate all offsets and positions of elements (called on window resize); refreshHard - reinit array with AOS...
Read more >
aos/README.md - UNPKG
*Duration accept values from 50 to 3000, with step 50ms, it's because duration of animation is handled by css, and to not make...
Read more >
How can I force a hard reload in Chrome for Android
I'm using window.location.reload(true) according to MDN (and this similar question) it forces page to reload from server. You can execute this code in...
Read more >
Images missing when a3 lay load and wp-optimize minify ...
So, i decided to disable the “Process Javascript files” in WP-O settings because it is simpler than try to resolve all my issues,...
Read more >
Aos NPM - npm.io
... with step 50ms disable: false, // accepts following values: 'phone', 'tablet', ... check AOS contribution guide and don't hesitate to create new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found